mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Move eager loading line_items to controller
This commit is contained in:
@@ -14,7 +14,7 @@ module Spree
|
||||
|
||||
def show
|
||||
@payments_requiring_action = PaymentsRequiringAction.new(spree_current_user).query
|
||||
@orders = orders_collection
|
||||
@orders = orders_collection.includes(:line_items)
|
||||
|
||||
customers = spree_current_user.customers
|
||||
@shops = Enterprise
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
- content_for :injection_data do
|
||||
= inject_json_array("orders", @orders.all.includes(:line_items), Api::OrderSerializer)
|
||||
= inject_json_array("orders", @orders.all, Api::OrderSerializer)
|
||||
= inject_json_array("shops", @shops.all, Api::ShopForOrdersSerializer)
|
||||
= inject_saved_credit_cards
|
||||
|
||||
|
||||
Reference in New Issue
Block a user