mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
Extract method
This commit is contained in:
@@ -17,9 +17,6 @@ module Spree
|
||||
end
|
||||
|
||||
def update_adjustments
|
||||
tax_adjustments =
|
||||
(item.respond_to?(:all_adjustments) ? item.all_adjustments : item.adjustments).tax
|
||||
|
||||
adjustment_total = adjustments.additional.map(&:update!).compact.sum
|
||||
included_tax_total = tax_adjustments.inclusive.reload.map(&:update!).compact.sum
|
||||
additional_tax_total = tax_adjustments.additional.reload.map(&:update!).compact.sum
|
||||
@@ -31,5 +28,11 @@ module Spree
|
||||
updated_at: Time.zone.now
|
||||
)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def tax_adjustments
|
||||
(item.respond_to?(:all_adjustments) ? item.all_adjustments : item.adjustments).tax
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user