Many-to-Many-to-Many relationship with need for another specific model
问题 I have a many-to-many relationship between Supermarket , Product and Brand through the Supply - and Origin -models. I also want to store which specific Product-Brand-Combination I have in my supermarket. I thought of another model (I called it Specific_Combination where I would store :supermarket_id , :product_id and :brand_id . class Supermarket < ActiveRecord::Base has_many :supplies has_many :products, :through => :supplies end class Supply < ActiveRecord::Base belongs_to :product belongs