[Rails] has_and_belongs_to_many associations

2013-04-24 Thread Paul Ols
Hi! I have a User model that has_and_belongs_to_many Awards. The awards table is pre-populated, and there's an awards_users join table. In a rails console, If I do: u = User.find(1) u.awards.build(award_id: 1) the award model that is built is an actual Award model, not an AwardsUser model, like

Re: [Rails] has_and_belongs_to_many associations

2013-04-24 Thread Colin Law
On 24 April 2013 09:19, Paul Ols li...@ruby-forum.com wrote: Hi! I have a User model that has_and_belongs_to_many Awards. The awards table is pre-populated, and there's an awards_users join table. In a rails console, If I do: u = User.find(1) u.awards.build(award_id: 1) the award model