mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-06 02:51:34 +00:00
Memoize OpenFoodNetwork::ScopeProductToHub
This means we avoid fetching all of the hub's variants every time we scope a product. Applies to every product loaded when displaying a shops's product list.
This commit is contained in:
@@ -40,7 +40,7 @@ class ProductsRenderer
|
||||
end
|
||||
|
||||
def product_scoper
|
||||
OpenFoodNetwork::ScopeProductToHub.new(distributor)
|
||||
@product_scoper ||= OpenFoodNetwork::ScopeProductToHub.new(distributor)
|
||||
end
|
||||
|
||||
def enterprise_fee_calculator
|
||||
|
||||
Reference in New Issue
Block a user