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.is_included.reload.map(&:update!).compact.sum
  additional_tax_total = tax.additional.reload.map(&:update!).compact.sum

  update_totals(included_tax_total, additional_tax_total)
end