Sha256: 79573a1c49bd2d85f329dc14a603d2cc6f58d897bb0678bfa3071f6eef020045
Contents?: true
Size: 499 Bytes
Versions: 6
Compression:
Stored size: 499 Bytes
Contents
module ShopDiscounts module Models module ShopProduct def self.included(base) base.class_eval do after_create :assign_discounts # Assigns discounts based off categories discounts def assign_discounts category.discounts.each do |discount| ShopDiscountable.create(:discount => discount, :discounted => self) end end end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems