]> git.openstreetmap.org Git - rails.git/commitdiff
Fix migration to work with mass assignment protection
authorTom Hughes <tom@compton.nu>
Tue, 6 Mar 2012 19:00:49 +0000 (19:00 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 6 Mar 2012 19:00:49 +0000 (19:00 +0000)
db/migrate/031_create_countries.rb

index 24331d6a833292cc4cc7bc28a7da5ec5ee5599c9..cc0627cd291fdc1b064811748b854015aa755653 100644 (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