From 07a6e62d0929a045e9e61b298bc35c0cacfcab3f Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Sun, 7 Apr 2019 00:28:04 +0100 Subject: [PATCH] Adapt query in product destroy process to rails 4 --- app/models/spree/product_decorator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/spree/product_decorator.rb b/app/models/spree/product_decorator.rb index a23f5501dc..33367ef319 100644 --- a/app/models/spree/product_decorator.rb +++ b/app/models/spree/product_decorator.rb @@ -189,7 +189,7 @@ Spree::Product.class_eval do OpenFoodNetwork::ProductsCache.product_deleted(self) do touch_distributors - ExchangeVariant.where('exchange_variants.variant_id IN (?)', variants_including_master.with_deleted).destroy_all + ExchangeVariant.where('exchange_variants.variant_id IN (?)', variants_including_master.with_deleted.select(:id)).destroy_all destroy_without_delete_from_order_cycles end