Hi, I have a list of incorrect cities name in Philippines:
>> a = City.find_all_by_country_id(4)
=> [#<City id: 91, name: "Alaminos", country_id: 4, created_at: "2009-11-12 04:06:14", updated_at: "2009-11-12 04:06:14">, #<City id: 92, name: "Angeles", country_id: 4, created_at: "2009-11-12 04:06:14", ...
And I wanted to replace all the names with the correct one:
=> b = ["Abra", "Agusan del Norte", "Agusan del Sur", ...
I wanted to use the replace
method because I wanted to update the existing city id, inserting/truncating them only if necessary.
But I still can't figure this one out, since a
is an array of arrays (correct me if I am wrong) while b
is just a simple, down-to-earth array.
Any advise would be deeply appreciated. Regards, MK