Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change city_lookup to load all configured cities
Closes thecodecrate#67 There is a problem with city_lookup. It only loads the cities for the first statue you called `cities` on. This is because `cities` memoizes all the cities for the country, but `city_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`: ```yaml BR: GO: "Mutunópolis": "Mutunópolis" ``` If I load first cities for other state, it does not include this missing city: ```shell bin/rails c CS.cities(:sp, :br) # loading another state first CS.cities(:go, :br).include?("Mutunópolis") ``` returned false but it should be true. If I load this state first, it works correctly ```shell bin/rails c CS.cities(:go, :br).include?("Mutunópolis") ``` This commit changes `city_lookup` to load all the cities for the country.
- Loading branch information