Class: Spree::Adjustable::Adjuster::Tax

Inherits:
Base
  • Object
show all
Defined in:
app/models/spree/adjustable/adjuster/tax.rb

Instance Method Summary collapse

Methods inherited from Base

adjust, #initialize

Constructor Details

This class inherits a constructor from Spree::Adjustable::Adjuster::Base

Instance Method Details

#updateObject



5
6
7
8
9
10
11
# File 'app/models/spree/adjustable/adjuster/tax.rb', line 5

def update
  tax = adjustments.tax
  included_tax_total = tax.find_all(&:included?).map(&:update!).compact.sum || 0
  additional_tax_total = tax.find_all(&:additional?).map(&:update!).compact.sum || 0

  update_totals(included_tax_total, additional_tax_total)
end