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.
A24e589de07cb769a71f28aead957a48?d=identicon&s=25 Duane (Guest)
on 2007-04-03 03: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?
588ab1c0a5610a7e160a3b101abb91e6?d=identicon&s=25 MichaelLatta (Guest)
on 2007-04-03 04: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.