Reputation: 2124
Let's say I have the models Developers and Projects, and developers has_and_belongs_to_many projects and projects has_and_belongs_to_many developers. What is the best way to set up the associations where one of the developer's projects should be his main project?
Upvotes: 2
Views: 105
Reputation: 4118
I would go with:
Developer
has_and_belongs_to_many :projects
has_one :main_project, :class_name => "Project"
Assuming the classes are Developer and Project.
Upvotes: 2