mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
This removes the N+1 queries caused by `Api::Admin::OrderSerialier#ready_to_capture` when used from `Api::OrdersController#index`. While it's fine for the single-order controller actions, it's not for this one that deals with a collection of orders. Fortunately, `SearchOrders` is used only in this controller action so we can put the `includes` calls there, otherwise, we would need to refactor it a bit to pass in a context-specific AR relation.