Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for v3.1 #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add support for v3.1 #6

wants to merge 1 commit into from

Conversation

jtapia
Copy link

@jtapia jtapia commented Jun 5, 2021

No description provided.

@jtapia jtapia force-pushed the chore/add-support-v3.1 branch from 71ec3f6 to 46419cc Compare June 5, 2021 19:21
@jtapia jtapia force-pushed the chore/add-support-v3.1 branch from 46419cc to 184cb34 Compare June 5, 2021 19:31
Copy link
Contributor

@ccarruitero ccarruitero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jtapia

Most changes seems good, just have a few doubts and comments


task default: %i(rubocop extension:specs)
task default: 'extension:specs'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to keep rubocop in default task, that way is more easier notice when is failing

@@ -5,6 +5,6 @@ class Locality < Spree::Base
belongs_to :state, class_name: 'Spree::State'
has_one :country, through: :state

validates :name, presence: true, uniqueness: { scope: :state_id }
validates :name, presence: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why need to remove this validation? I think we should keep to ensure don't have duplicated cities for state

@@ -24,7 +24,7 @@
locality do |address|
state = address.state
Spree::Locality.find_by(name: city_name, state: state) ||
create(:city, name: city_name, state: state)
create(:locality, name: city_name, state: state)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our factory is named :city right now, If we plan to use :locality instead should update the factory definition too.

spec.version = SolidusZonesByCity::VERSION
spec.authors = ['César Carruitero']
spec.email = 'ccarruitero@protonmail.com'
Gem::Specification.new do |s|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think is unnecessary rename the block variable

Comment on lines +8 to +9
s.authors = ['César Carruitero']
s.email = 'ccarruitero@protonmail.com'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was added when bootstrap the extension, but should be updated to Magma Labs

spec.license = 'BSD-3-Clause'
s.summary = 'Allow zones at city level'
s.description = s.summary
s.homepage = 'http://github.com/magma-labs/solidus_zones_by_city'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to keep https in urls

s.add_dependency 'solidus_core', ['>= 2.5', '< 4']
s.add_dependency 'solidus_support', '~> 0.5'

s.add_development_dependency 'autoprefixer-rails', '~> 10.2.5'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Until I can see in their repository, is for add browser prefix in our css. I think we should avoid use browser specific css and instead use standard css.

s.add_dependency 'solidus_support', '~> 0.5'

s.add_development_dependency 'autoprefixer-rails', '~> 10.2.5'
s.add_development_dependency 'rspec-activemodel-mocks'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking into gem repository doesn't found a good reason to add. What is the advance of using this gem over use double and allow/receive for mock and stub?

@@ -20,8 +18,8 @@
# in spec/support/ and its subdirectories.
Dir["#{__dir__}/support/**/*.rb"].sort.each { |f| require f }

# Requires factories defined in lib/solidus_zones_by_city/factories.rb
require 'solidus_zones_by_city/factories'
# Requires factories defined in lib/solidus_related_products/testing_support/factories.rb
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a typo here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants