Open duduribeiro opened 9 months ago
@duduribeiro Hello 👋 Any updates on this^? We are facing a similar issue when trying to add cities using the cities-lookup
file. I have successfully renamed a country and state using the country and state lookup files but have not been able to add a city. Thx!
hey @viviancan 👋
I'm not a maintainer of the repo, so I can't merge.
What you can do is use this commit (like I'm doing in my app).
You can add this on your Gemfile
gem "city-state", github: "duduribeiro/city-state", branch: "fix-lookup-cities"
and check if it works on your case. It worked for me
hey @viviancan 👋
I'm not a maintainer of the repo, so I can't merge.
What you can do is use this commit (like I'm doing in my app).
You can add this on your Gemfile
gem "city-state", github: "duduribeiro/city-state", branch: "fix-lookup-cities"
and check if it works on your case. It worked for me
@duduribeiro Thank you for the tip 😄 Hopefully there will be some feedback on this issue soon!
Closes #67 There is a problem with city_lookup. It only loads the cities for the first statue you called
cities
on. This is becausecities
memoizes all the cities for the country, butcity_lookup
only loads the cities for the state, and doesn't get called again for the other states.Ex:
having the following
db/cities-lookup.yml
:If I load first cities for other state, it does not include this missing city:
returned false but it should be true.
If I load this state first, it works correctly
This commit changes
city_lookup
to load all the cities for the country.