fix: add country code assignment in city creation

- Include assignment of country code when creating a city
- Ensure that all relevant geographical data is accounted for during
  the city creation process

This change addresses a missing assignment of the country code for new
city records, ensuring that instances are complete and accurate.
This commit is contained in:
songtianlun 2025-02-11 17:59:23 +08:00
parent b2551361d7
commit d37d06c0d7

View File

@ -168,6 +168,7 @@ namespace :geo do
city = City.find_or_create_by!(name: data["name"]) do |c|
c.country_id = country.id,
c.country_code = country.code,
c.latitude = data["latitude"],
c.longitude = data["longitude"]
end