Forum: Ruby on Rails Many to many relation in one model

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Damaris F. (Guest)
on 2007-01-05 21:23
Hi you all,

I have a model called Property where a property is related with many
properties.
I was gonna deal with this by having a has-and-belongs-to-many relation
but… what should I write in the SQL database? Would it be a
"properties_properties" table? And the attributes? :S

Thanks.
Adam B. (Guest)
on 2007-01-06 05:19
This is called a self-referential association. If you Google for "rails
self-referential" you'll get a lot of useful stuff.

/afb
Damaris F. (Guest)
on 2007-01-08 02:56
Adam B. wrote:
> This is called a self-referential association. If you Google for "rails
> self-referential" you'll get a lot of useful stuff.
>
> /afb

Thanks! searching  I found a very useful article :) :
http://www.fallenrogue.com/article/view/143-I-am-w...
This topic is locked and can not be replied to.