Merge pull request #13178 from cyrillefr/FixRubocopLintIssuesI

Fixes some rubocop linting offenses
This commit is contained in:
Maikel
2025-02-28 10:40:56 +11:00
committed by GitHub
4 changed files with 2 additions and 30 deletions

View File

@@ -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:

View File

@@ -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?

View File

@@ -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?

View File

@@ -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}?") ||