mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Avoid N+1s in Order#cap_quantity_at_stock!
This commit is contained in:
@@ -210,7 +210,7 @@ Spree::Order.class_eval do
|
||||
end
|
||||
|
||||
def cap_quantity_at_stock!
|
||||
line_items.each(&:cap_quantity_at_stock!)
|
||||
line_items.includes(variant: :stock_items).all.each(&:cap_quantity_at_stock!)
|
||||
end
|
||||
|
||||
def set_distributor!(distributor)
|
||||
|
||||
Reference in New Issue
Block a user