fix: update region name and clear code

- Update region name with data from the input
- Set code to nil to reset any previous values
- Preserve other attributes like translations, flag, and wiki_data_id

This change ensures that region data is updated correctly with the
provided input while eliminating any previous code settings that may
no longer be relevant.
This commit is contained in:
songtianlun 2025-02-10 17:37:11 +08:00
parent e774b3e736
commit 97330fef91

View File

@ -28,6 +28,8 @@ namespace :geo do
count += 1
region.update(
name: data["name"],
code: nil,
translations: data["translations"],
flag: data["flag"] || true,
wiki_data_id: data["wikiDataId"]