From bb46df61d4b2bbd80f5225eb54a0bd5c5a32700d Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Fri, 5 Mar 2021 18:06:27 +0000 Subject: [PATCH] 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). --- app/models/spree/order.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/models/spree/order.rb b/app/models/spree/order.rb index b1731b42d4..32c5e9e151 100644 --- a/app/models/spree/order.rb +++ b/app/models/spree/order.rb @@ -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