Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Fix Italy state seed generation #3722
Conversation
|
@seand7565 LGTM |
|
Left a couple of comments, thanks @seand7565 |
ebbb356
to
c9c60d8
Previously, Italy was using the top-level `subregions` - `regions` in Carmen to generate states, however for a mailing address this is incorrect, and it instead needs to use `provinces`, which is nested as the second level of `subregions` in Carmen. This fixes the seed generation, allowing for more countries to make this switch as necessary (there are a handful of other countries that need this) If you want an easy (and possibly destructive) method to update your states, see the following gist, which contains a rake task for you to run: https://gist.github.com/seand7565/6342d7ce7a89b2412fcb4eab7f2c8a61
|
@kennyadsl if this good to go for you? Feel free to merge if yes! |
23511db
into
solidusio:master
Description
Previously, Italy was using the top-level
subregions-regionsin Carmen to generate states, however for a mailing address this
is incorrect, and it instead needs to use
provinces, which isnested as the second level of
subregionsin Carmen. This fixes theseed generation, allowing for more countries to make this switch
as necessary (there are a handful of other countries that need this)
Also, adds aThis has been moved to a rake task, if you wantstate:regeneraterake task that updates states forcountries that were generated incorrectly, like Italy. This is so
people updgrading from v2.10 to v2.11 can easily update to the
correct state list.
this functionality, you'll need to copy it over into your own code!
https://gist.github.com/seand7565/6342d7ce7a89b2412fcb4eab7f2c8a61
This PR only fixes Italy, but lays down some structure to allow fixing
other countries that need this treatment. For instance, if Spain needs
to use the nested subregions instead of the top-level subregions, we
just need to add Spains ISO code to
countries_that_use_nested_subregionsin
states.rband the ISO array on line 7 ofstates.rake.Ref: #3670
Checklist: