diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 42a63b3b7d..5196330f3f 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -57,26 +57,6 @@ Lint/RedundantDirGlobSort: - 'engines/dfc_provider/spec/spec_helper.rb' - 'spec/system_helper.rb' -# Offense count: 1 -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: AllowedMethods. -# AllowedMethods: instance_of?, kind_of?, is_a?, eql?, respond_to?, equal?, presence, present? -Lint/RedundantSafeNavigation: - Exclude: - - 'app/models/spree/payment.rb' - -# Offense count: 1 -Lint/SelfAssignment: - Exclude: - - 'app/models/spree/order/checkout.rb' - -# Offense count: 1 -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: AutoCorrect. -Lint/UselessMethodDefinition: - Exclude: - - 'app/models/spree/gateway.rb' - # Offense count: 24 # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max. Metrics/AbcSize: diff --git a/app/models/spree/gateway.rb b/app/models/spree/gateway.rb index 42fc9b6eec..9dd4046c3a 100644 --- a/app/models/spree/gateway.rb +++ b/app/models/spree/gateway.rb @@ -17,11 +17,6 @@ module Spree CreditCard end - # instantiates the selected gateway and configures with the options stored in the database - def self.current - super - end - def provider gateway_options = options gateway_options.delete :login if gateway_options.key?(:login) && gateway_options[:login].nil? diff --git a/app/models/spree/order/checkout.rb b/app/models/spree/order/checkout.rb index e51ffe442a..3352b971bf 100644 --- a/app/models/spree/order/checkout.rb +++ b/app/models/spree/order/checkout.rb @@ -40,10 +40,7 @@ module Spree klass.next_event_transitions.each { |t| transition(t.merge(on: :next)) } # Persist the state on the order - after_transition do |order| - order.state = order.state - order.save - end + after_transition ->(order) { order.save } event :cancel do transition to: :canceled, if: :allow_cancel? diff --git a/app/models/spree/payment.rb b/app/models/spree/payment.rb index 6479694df9..a2330f6124 100644 --- a/app/models/spree/payment.rb +++ b/app/models/spree/payment.rb @@ -129,7 +129,7 @@ module Spree end def actions - return [] unless payment_source&.respond_to?(:actions) + return [] unless payment_source.respond_to?(:actions) payment_source.actions.select do |action| !payment_source.respond_to?("can_#{action}?") ||