arumoy-shome / UWNerdist

Got free time? Check out what classes are going on at the UW campus that interest you!
MIT License
1 stars 1 forks source link

Relate Terms and Subjects #51

Closed arumoy-shome closed 7 years ago

arumoy-shome commented 7 years ago

This is going to be a many to many relation:

arumoy-shome commented 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.