, . , , ( -). , , , , , , . , , promotion_id.
class Store
has_many :store_items, dependent: :destroy
has_many :items, through: :store_items
end
class Item
has_many :store_items, dependent: :destroy
has_many :items, though: :store_items
end
class Promotion
has_many :store_items, dependent: :nullify
end
class StoreItem
belongs_to: :item
belongs_to: :store
belongs_to: :promotion, optional: true
end
StoreItem Promotion StoreItem, , , StoreItem , .