Displaying 1 result from an estimated 1 matches for "crate_id".
Did you mean:
create_id
2007 Nov 13
4
has_and_belongs_to_many between the same model
Hi! I have two models: Jewel and Crate. A crate can contain other crates
and it can also contain as many jewels as we want. So, in jewel.rb i
put:
[code]
belongs_to :crate
[/code]
and in crate.rb:
[code]
has_many :jewels
has_and_belongs_to_many :crates
[/code]
Now i have to create the join table "crates_crates" but i really have no
idea on how to specify the first index is the