1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-29 18:52:22 +01:00

(quality) add eager loading for orders

This commit is contained in:
Sylvain 2022-09-28 10:34:02 +02:00
parent eb50c37419
commit a8b9ebb665

View File

@ -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)