From 97330fef911b4b9ee3d03b1ada751d6ffe5ffd1b Mon Sep 17 00:00:00 2001 From: songtianlun Date: Mon, 10 Feb 2025 17:37:11 +0800 Subject: [PATCH] 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. --- lib/tasks/sync_geo_data.rake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/tasks/sync_geo_data.rake b/lib/tasks/sync_geo_data.rake index b4eb832..8ca40da 100644 --- a/lib/tasks/sync_geo_data.rake +++ b/lib/tasks/sync_geo_data.rake @@ -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"]