Rails: is it possible to add extra attribute to a has_and_belongs_to_many association?
What I mean is if I have two models, connected by a has_and_belongs_to_many association, can I store other data in the join table for each association? That is, the extra data would not be part of a single record in either table, but instead of the connection between them. My actual models are as follows: class Part < ActiveRecord::Base has_and_belongs_to_many :assemblies has_and_belongs_to_many :packages belongs_to :user validates :name, :user_id, :presence => true end class Package < ActiveRecord::Base has_and_belongs_to_many :parts belongs_to :user end So the point is that each part is