Module: SolidusLegacyPromotions::SpreeLineItemDecorator

Defined in:
app/decorators/solidus_legacy_promotions/models/spree_line_item_decorator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.prepended(base) ⇒ Object



5
6
7
8
# File 'app/decorators/solidus_legacy_promotions/models/spree_line_item_decorator.rb', line 5

def self.prepended(base)
  base.has_many :line_item_actions, dependent: :destroy
  base.has_many :actions, through: :line_item_actions
end

Instance Method Details

#total_before_taxObject



10
11
12
# File 'app/decorators/solidus_legacy_promotions/models/spree_line_item_decorator.rb', line 10

def total_before_tax
  amount + adjustments.select { |value| !value.tax? && value.eligible? }.sum(&:amount)
end