Closed arumoy-shome closed 7 years ago
From the Rails guides:
The simplest rule of thumb is that you should set up a has_many :through relationship if you need to work with the relationship model as an independent entity. If you don't need to do anything with the relationship model, it may be simpler to set up a has_and_belongs_to_many relationship (though you'll need to remember to create the joining table in the database).
You should use has_many :through if you need validations, callbacks or extra attributes on the join model.
Since I don't need either of those, I think a simple has_and_belongs_to_many
will do the trick here.
This is going to be a many to many relation: