From 312a6299a84d85dc1b5b87291ea3dc7e3edabdb3 Mon Sep 17 00:00:00 2001 From: Rob Harrington Date: Fri, 15 May 2015 21:19:16 +1000 Subject: [PATCH] Making where clause unambiguous --- app/controllers/spree/admin/reports_controller_decorator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/spree/admin/reports_controller_decorator.rb b/app/controllers/spree/admin/reports_controller_decorator.rb index 3aa4f560a17..34f2d640c21 100644 --- a/app/controllers/spree/admin/reports_controller_decorator.rb +++ b/app/controllers/spree/admin/reports_controller_decorator.rb @@ -416,7 +416,7 @@ def orders_and_fulfillment @line_items = permissions.visible_line_items.merge(Spree::LineItem.where(order_id: orders)) @line_items = @line_items.supplied_by_any(params[:supplier_id_in]) if params[:supplier_id_in].present? - line_items_with_hidden_details = @line_items.where("id NOT IN (?)", permissions.editable_line_items) + line_items_with_hidden_details = @line_items.where('"spree_line_items"."id" NOT IN (?)', permissions.editable_line_items) @line_items.select{ |li| line_items_with_hidden_details.include? li }.each do |line_item| # TODO We should really be hiding customer code here too, but until we # have an actual association between order and customer, it's a bit tricky