Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
Appease Rubocop with auto-correction
Browse files Browse the repository at this point in the history
Also disable Rubocop Naming rule because `last_4` is used by braintree
gem.
  • Loading branch information
Flavio Auciello committed Apr 9, 2021
1 parent 103b77d commit b810856
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ Layout/FirstHashElementIndentation:
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented

Naming/VariableNumber:
Enabled: false

# We use this extensively, the alternatives are not viable or desirable.
RSpec/AnyInstance:
Enabled: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def lastname
def full_name
name
end

unless ::Spree::Address.methods.include?(:firstname)
::Spree::Address.prepend self
end
Expand Down
10 changes: 5 additions & 5 deletions app/models/solidus_paypal_braintree/transaction_address.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ def to_spree_address
)

if SolidusSupport.combined_first_and_last_name_in_address?
if first_name.nil?
address.name = name
else
address.name = [first_name, last_name].join(" ")
end
address.name = if first_name.nil?
name
else
[first_name, last_name].join(" ")
end
else
::Spree::Deprecation.warn("first_name and last_name are deprecated. Use name instead.", caller)
if first_name.nil?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ def copy_initializer
end

def add_javascripts
append_file 'vendor/assets/javascripts/spree/frontend/all.js', "//= require spree/frontend/solidus_paypal_braintree\n"
append_file 'vendor/assets/javascripts/spree/backend/all.js', "//= require spree/backend/solidus_paypal_braintree\n"
append_file 'vendor/assets/javascripts/spree/frontend/all.js',
"//= require spree/frontend/solidus_paypal_braintree\n"
append_file 'vendor/assets/javascripts/spree/backend/all.js',
"//= require spree/backend/solidus_paypal_braintree\n"
end

def add_stylesheets
Expand Down
4 changes: 3 additions & 1 deletion lib/solidus_paypal_braintree/testing_support/factories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
factory :address do
zipcode { '21088-0255' }

unless SolidusSupport.combined_first_and_last_name_in_address?
if SolidusSupport.combined_first_and_last_name_in_address?
name { 'John Doe' }
else
transient do
name { "John Doe" }
end
Expand Down
4 changes: 2 additions & 2 deletions solidus_paypal_braintree.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ Gem::Specification.new do |spec|
spec.add_dependency 'solidus_core', ['>= 2.0.0', '< 3']
spec.add_dependency 'solidus_support', ['>= 0.8.1', '< 1']

spec.add_development_dependency 'solidus_dev_support', '~> 2.4'
spec.add_development_dependency 'selenium-webdriver'
spec.add_development_dependency 'rails-controller-testing'
spec.add_development_dependency 'selenium-webdriver'
spec.add_development_dependency 'solidus_dev_support', '~> 2.4'
spec.add_development_dependency 'vcr'
spec.add_development_dependency 'webmock'
end
1 change: 0 additions & 1 deletion spec/models/solidus_paypal_braintree/gateway_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
require 'spec_helper'
require 'webmock'
require 'support/order_ready_for_payment'
Expand Down

0 comments on commit b810856

Please sign in to comment.