Sha256: 711b075e444b781a84d82b1a381d0b87075513a895ce953573b5ef3cc45ade68
Contents?: true
Size: 545 Bytes
Versions: 4
Compression:
Stored size: 545 Bytes
Contents
module ShopPackages module Models module ShopPackageable def self.included(base) base.class_eval do has_many :packings, :class_name => 'ShopPacking', :foreign_key => :product_id, :dependent => :destroy has_many :packages, :class_name => 'ShopPackage', :foreign_key => :package_id, :through => :packings, :source => :package has_many :related, :class_name => 'ShopProduct', :through => :packings, :source => :product, :uniq => true end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems