Sha256: 2b47eecf52dbe7d5a952729f51523d3b98a44aff7f5f9f65d28e018d1a92b8dc

Contents?: true

Size: 435 Bytes

Versions: 2

Compression:

Stored size: 435 Bytes

Contents

module ShopDiscounts
  module Models
    module CategoryDiscountable
      
      def self.included(base)
        base.class_eval do
          has_many  :discountables, :class_name => 'CategoryShopDiscountable', :foreign_key  => :discounted_id, :dependent => :destroy
          has_many  :discounts,     :class_name => 'ShopDiscount',             :through      => :discountables          
        end
      end
      
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
radiant-shop_discounts-extension-0.0.10 lib/shop_discounts/models/category_discountable.rb
radiant-shop_discounts-extension-0.0.9 lib/shop_discounts/models/category_discountable.rb