Which ActiveRecord association should I use? “Has and Belongs to Many” or “Has Many Through”?

One of the things many newcomers to Rails (especially those with no relational database experience) find confusing is choosing between two of ActiveRecord’s association methods – the infamous “has_and_belongs_to_many” in comparison to “has_many :through”. But don’t worry; you’re not being dumb. They actually look very similar, but do two different things, and which one you… Continue reading