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.
28a4d1b683ec25e1d0312a2a90f63b6f?d=identicon&s=25 Damaris Fuentes (damaris)
on 2007-01-05 20: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.
B15edcdfdbecf5723067df3e24e4f6f0?d=identicon&s=25 Adam Block (adamblock)
on 2007-01-06 04:19
This is called a self-referential association. If you Google for "rails
self-referential" you'll get a lot of useful stuff.

/afb
28a4d1b683ec25e1d0312a2a90f63b6f?d=identicon&s=25 Damaris Fuentes (damaris)
on 2007-01-08 01:56
Adam Block 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.