From f25de984d2ab45f7f530115eaee2097ecda2fc26 Mon Sep 17 00:00:00 2001 From: Cillian O'Ruanaidh Date: Mon, 20 Jun 2022 21:06:16 +0100 Subject: [PATCH] Use .empty? instead of !exists? in app/models/order_cycle_shipping_method.rb Co-authored-by: Maikel --- app/models/order_cycle_shipping_method.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/order_cycle_shipping_method.rb b/app/models/order_cycle_shipping_method.rb index 4d53a2f3bf..e2df849ad6 100644 --- a/app/models/order_cycle_shipping_method.rb +++ b/app/models/order_cycle_shipping_method.rb @@ -14,10 +14,10 @@ class OrderCycleShippingMethod < ApplicationRecord private def shipping_method_not_selected_on_any_orders? - !Spree::Order.joins(shipments: :shipping_rates).where( + Spree::Order.joins(shipments: :shipping_rates).where( "order_cycle_id = ? AND spree_shipping_rates.shipping_method_id = ?", order_cycle_id, shipping_method_id - ).exists? + ).empty? end def check_shipping_method_not_selected_on_any_orders