From 0202b596347648ddcff5f611c7d7de9ed582a46c Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Tue, 10 Dec 2019 21:18:17 +0000 Subject: [PATCH] Remove eager loding of shipping_methods and shipping_rates from customer_totals so that report runs faster Something makes the query run much slower with these includes --- .../orders_and_fulfillments_report/customer_totals_report.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/open_food_network/orders_and_fulfillments_report/customer_totals_report.rb b/lib/open_food_network/orders_and_fulfillments_report/customer_totals_report.rb index c509ce631e..593933e157 100644 --- a/lib/open_food_network/orders_and_fulfillments_report/customer_totals_report.rb +++ b/lib/open_food_network/orders_and_fulfillments_report/customer_totals_report.rb @@ -192,7 +192,7 @@ module OpenFoodNetwork def line_item_includes [{ variant: [{ option_values: :option_type }, { product: :supplier }], order: [:bill_address, :ship_address, :order_cycle, :adjustments, :payments, - :user, :distributor, shipments: { shipping_rates: :shipping_method }] }] + :user, :distributor, :shipments] }] end private