Simplify Order#total_tax

We get the same value here, but without the three additional database hits to adjustments (both of these values are already present on the order object itself).
This commit is contained in:
Matt-Yorkley
2021-03-05 18:06:27 +00:00
parent c07a4e6c55
commit bb46df61d4

View File

@@ -662,9 +662,7 @@ module Spree
end
def total_tax
adjustments.sum(:included_tax) +
shipment_adjustments.sum(:included_tax) +
line_item_adjustments.tax.sum(:amount)
additional_tax_total + included_tax_total
end
def has_taxes_included