Sha256: 12e0f3ff6329ecf8943e6764f40d9e44b6631a0396aacc9cc18ff5c7033b477c

Contents?: true

Size: 521 Bytes

Versions: 2

Compression:

Stored size: 521 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
          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

2 entries across 2 versions & 1 rubygems

Version Path
radiant-shop_packages-extension-0.0.2 lib/shop_packages/models/shop_packageable.rb
radiant-shop_packages-extension-0.0.1 lib/shop_packages/models/shop_packageable.rb