From a8b9ebb665c75325d32e16d47a8de5cdbeaca356 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Wed, 28 Sep 2022 10:34:02 +0200 Subject: [PATCH] (quality) add eager loading for orders --- app/services/orders/order_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/orders/order_service.rb b/app/services/orders/order_service.rb index 2d724c424..06409c2dc 100644 --- a/app/services/orders/order_service.rb +++ b/app/services/orders/order_service.rb @@ -6,7 +6,7 @@ class Orders::OrderService ORDERS_PER_PAGE = 20 def list(filters, current_user) - orders = Order.where(nil) + orders = Order.includes([:statistic_profile]).where(nil) orders = filter_by_user(orders, filters, current_user) orders = filter_by_reference(orders, filters, current_user) orders = filter_by_state(orders, filters)