ruby on rails - Many to Many association with Single table inheritance -
i looking many-to-many association within child models. below. can please guide what's best way it.
parent
class < activerecord::base end
child1
class b < has_many :bc has_many :c ,through: :bc end
child2
class c < has_many :bc has_many :b, through: :bc end
if don't need columns, use has_and_belongs_to_many can read http://guides.rubyonrails.org/association_basics.html
Comments
Post a Comment