refactor: change region identification method

- Update the region lookup to use `name` instead of `id`
- This change allows for more flexible region identification
- Improves alignment with potential data structure changes
This commit is contained in:
songtianlun 2025-02-10 17:19:58 +08:00
parent 27100aec24
commit bafb889144

View File

@ -22,8 +22,7 @@ namespace :geo do
count = 1 count = 1
regions.each do |data| regions.each do |data|
region = Region.find_or_initialize_by(id: data["id"]) do |r| region = Region.find_or_initialize_by(name: data["name"]) do |r|
r.name = data["name"]
end end
puts "Sync Regions[#{count}/#{sum}]: [#{region.name}]" puts "Sync Regions[#{count}/#{sum}]: [#{region.name}]"
count += 1 count += 1