]> git.openstreetmap.org Git - rails.git/blobdiff - db/migrate/20120208122334_merge_acl_address_and_mask.rb
Check that fractional part is present after . in geocoder latlon tests
[rails.git] / db / migrate / 20120208122334_merge_acl_address_and_mask.rb
index 9153da1e5ab87680765764c0236858cdaf587175..5cac1074051770992b7ede7a6c9f35f6e92f65ac 100644 (file)
@@ -10,7 +10,10 @@ class IPAddr
   end
 end
 
   end
 end
 
-class MergeAclAddressAndMask < ActiveRecord::Migration
+class MergeAclAddressAndMask < ActiveRecord::Migration[4.2]
+  class Acl < ApplicationRecord
+  end
+
   def up
     Acl.find_each do |acl|
       address = IPAddr.new(acl.address)
   def up
     Acl.find_each do |acl|
       address = IPAddr.new(acl.address)
@@ -18,7 +21,7 @@ class MergeAclAddressAndMask < ActiveRecord::Migration
       prefix = 0
 
       while netmask != "0.0.0.0"
       prefix = 0
 
       while netmask != "0.0.0.0"
-        netmask = netmask << 1
+        netmask <<= 1
         prefix += 1
       end
 
         prefix += 1
       end