Module: SolidusPromotions::LineItemPatch

Defined in:
app/patches/models/solidus_promotions/line_item_patch.rb

Class Method Summary collapse

Class Method Details

.prepended(base) ⇒ Object



5
6
7
8
9
10
# File 'app/patches/models/solidus_promotions/line_item_patch.rb', line 5

def self.prepended(base)
  base.attr_accessor :quantity_setter
  base.belongs_to :managed_by_order_benefit, class_name: "SolidusPromotions::Benefit", optional: true
  base.validate :validate_managed_quantity_same, on: :update
  base.after_save :reset_quantity_setter
end