From 97f551a2dd21e5fcd64f0fb74004525c4625d93d Mon Sep 17 00:00:00 2001 From: Pau Perez Date: Thu, 23 Jul 2020 17:37:50 +0200 Subject: [PATCH] Replace literal with AR's 4 `#not` --- app/models/spree/payment.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/spree/payment.rb b/app/models/spree/payment.rb index 8b54e5c760..754119034a 100644 --- a/app/models/spree/payment.rb +++ b/app/models/spree/payment.rb @@ -187,7 +187,7 @@ module Spree # Makes newly entered payments invalidate previously entered payments so the most recent payment # is used by the gateway. def invalidate_old_payments - order.payments.with_state('checkout').where("id != ?", id).each do |payment| + order.payments.with_state('checkout').where.not(id: id).each do |payment| # Using update_column skips validations and so it skips validate_source. As we are just # invalidating past payments here, we don't want to validate all of them at this stage. payment.update_column(:state, 'invalid')