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:
parent
b2551361d7
commit
d37d06c0d7
@ -168,6 +168,7 @@ namespace :geo do
|
|||||||
|
|
||||||
city = City.find_or_create_by!(name: data["name"]) do |c|
|
city = City.find_or_create_by!(name: data["name"]) do |c|
|
||||||
c.country_id = country.id,
|
c.country_id = country.id,
|
||||||
|
c.country_code = country.code,
|
||||||
c.latitude = data["latitude"],
|
c.latitude = data["latitude"],
|
||||||
c.longitude = data["longitude"]
|
c.longitude = data["longitude"]
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user