
docs/associations.html should have more docs about :through
Reported by Jeremy Nicoll | August 8th, 2008 @ 01:23 PM
In the model that is the target of the :through, it is important that it has the belongs_to for the two other tables. For example:
class User
has n, :user_categories
has n, :categories, :through => :user_categories
end
class UserCategory
belongs_to :user
belongs_to :category
end
This may not be obvious to everyone and I feel it would be beneficial to have this on the docs page for associations.
Comments and changes to this ticket
-
Jonathan Stott (namelessjon) December 12th, 2008 @ 01:16 PM
- Assigned user cleared.
- State changed from new to resolved
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »