Shopify / Shopify/worldwide

Ireland Address normalize doesn't fill province code

Open
#401 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
97
Forks
17
Avg merge
13h 33m
Merged PRs (30d)
11

Description

While creating an address for Ireland with valid data , it doesnt populate province_code which makes the address not valid

params = { :first_name=>"John", :last_name=>"Doe", :address1=>"Bedford Hall", :address2=>"34 Castle Street", :city=>"Dublin", :zip=>"D02 TN97", :phone=>"", :country_code=>"IE"}

address = Worldwide.address(**params).normalize(autocorrect_level: 9) => #<Worldwide::Address:0x0000ffff88794a68 @address1="Bedford Hall", @address2="34 Castle Street", @city="Dublin", @company=nil, @country_code="IE", @first_name="John", @last_name="Doe", @line2=nil, @neighborhood=nil, @phone="", @province_code=nil, @street_name=nil, @street_number=nil, @zip="D02 TN97">

address.valid? => false

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Ireland example with Worldwide.address(**params).normalize(autocorrect_level: 9), then inspect the normalization and validation paths for country code IE and province_code. Done means the normalized address receives the expected province_code and address.valid? returns true for the supplied data.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
localization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.