Question: What is the difference between the  

`has_and_belongs_to_many` and  

`has_many through` relationships? When and where to use which one?

Answer: 
You should use has\_many :through if you need validations, callbacks, or extra attributes on the join model.
The simplest rule of thumb is that you can go with `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.