Module: ShopDiscounts::Models::CategoryDiscountable

Defined in:
lib/shop_discounts/models/category_discountable.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
8
9
10
# File 'lib/shop_discounts/models/category_discountable.rb', line 5

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