Fix spec by adding necessary references statement

This commit is contained in:
Luis Ramos
2020-10-16 00:35:47 +01:00
committed by Matt-Yorkley
parent ff17ced101
commit 1d32ecab98

View File

@@ -60,7 +60,7 @@ module OpenFoodNetwork
def filter_to_supplier(orders)
if params[:supplier_id].to_i > 0
orders.select do |order|
order.line_items.includes(:product).where("spree_products.supplier_id = ?", params[:supplier_id].to_i).count > 0
order.line_items.includes(:product).references(:product).where("spree_products.supplier_id = ?", params[:supplier_id].to_i).count > 0
end
else
orders