Forum: Ruby on Rails What's the pattern for "has many of yourself"?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Duane (Guest)
on 2007-04-03 05:33
I feel like I should kow this, but it's ust not coming to me.  I have a
model that points to a bunch of "related" instances of itself.  That is,
Foo has_many :foos.

How am I supposed to model that relationship?  If I do a "has and
belongs to many"  then I'm going to end up with a majors_majors table?
MichaelLatta (Guest)
on 2007-04-03 06:05
(Received via mailing list)
has_many :foos
belongs_to :foo

should work with a foo_id column in the table.

This topic is locked and can not be replied to.