Fix migration to work with mass assignment protection

This commit is contained in:
Tom Hughes 2012-03-06 19:00:49 +00:00
parent d9ba72e66f
commit 1cc882b23f

View file

@ -24,9 +24,11 @@ class CreateCountries < ActiveRecord::Migration
maxlon = ele.get_text("bBoxEast").to_s
maxlat = ele.get_text("bBoxNorth").to_s
Country.create(:code => code,
:min_lat => minlat.to_f, :max_lat => maxlat.to_f,
:min_lon => minlon.to_f, :max_lon => maxlon.to_f)
Country.create({
:code => code,
:min_lat => minlat.to_f, :max_lat => maxlat.to_f,
:min_lon => minlon.to_f, :max_lon => maxlon.to_f
}, :without_protection => true)
end
end
end