mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-15 23:57:48 +00:00
Merge pull request #7580 from apricot12/Remove-LineItems-N+1
Removed N+1 queries while counting line_items
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
|
||||
|
||||
@@ -22,7 +22,7 @@ module Api
|
||||
end
|
||||
|
||||
def item_count
|
||||
object.line_items.sum(:quantity)
|
||||
object.line_items.sum(&:quantity)
|
||||
end
|
||||
|
||||
def completed_at
|
||||
|
||||
Reference in New Issue
Block a user