From e6943ce554e38cb4593ad081a1f67b9638fee914 Mon Sep 17 00:00:00 2001 From: Pau Perez Date: Wed, 22 Jul 2020 17:11:32 +0200 Subject: [PATCH] Fix simple Rubocop issues --- app/models/spree/payment.rb | 1 - app/models/spree/payment/processing.rb | 16 +++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/models/spree/payment.rb b/app/models/spree/payment.rb index 13fc27c6aa..9ca91809dc 100644 --- a/app/models/spree/payment.rb +++ b/app/models/spree/payment.rb @@ -188,7 +188,6 @@ module Spree # is used by the gateway. def invalidate_old_payments order.payments.with_state('checkout').where("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') diff --git a/app/models/spree/payment/processing.rb b/app/models/spree/payment/processing.rb index 724df22d87..2579f76de7 100644 --- a/app/models/spree/payment/processing.rb +++ b/app/models/spree/payment/processing.rb @@ -147,13 +147,15 @@ module Spree record_response(response) if response.success? - self.class.create!(order: order, - source: self, - payment_method: payment_method, - amount: refund_amount.abs * -1, - response_code: response.authorization, - state: 'completed', - skip_source_validation: true) + self.class.create!( + order: order, + source: self, + payment_method: payment_method, + amount: refund_amount.abs * -1, + response_code: response.authorization, + state: 'completed', + skip_source_validation: true + ) else gateway_error(response) end