Replace literal with AR's 4 #not

This commit is contained in:
Pau Perez
2020-07-23 17:37:50 +02:00
parent 357037e429
commit 97f551a2dd

View File

@@ -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')