Create a many-to-many ActiveRecord association in Ruby on Rails with has_many :through and has_and_belongs_to_many
posted in articles
A common obstacle when building web applications are relational database associations. Without these it would be difficult to decrease the amount of duplicate data as well as increasing the overall database efficiency. The most common relationships are the: one-to-one, one-to-many, and many-to-many.