Eager-load serialized objects in variant query

This commit is contained in:
Matt-Yorkley
2019-09-29 20:44:48 +01:00
parent 032741c54f
commit 6153789055

View File

@@ -59,6 +59,7 @@ module OpenFoodNetwork
scoper = OpenFoodNetwork::ScopeVariantToHub.new(@distributor)
shop_products_service.variants_relation.
includes(:default_price, :stock_locations, :product).
where(product_id: shop_products).
each { |v| scoper.scope(v) }
end