]> git.openstreetmap.org Git - rails.git/blobdiff - db/migrate/20120208122334_merge_acl_address_and_mask.rb
Merge remote-tracking branch 'upstream/pull/4336'
[rails.git] / db / migrate / 20120208122334_merge_acl_address_and_mask.rb
index 791bf659a9023ce5da57eb3c0c9a29d0a3c5be52..09b0ae3b07c90f9869e04a418fb66897575ffbbb 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)
@@ -19,7 +22,7 @@ class MergeAclAddressAndMask < ActiveRecord::Migration
 
       while netmask != "0.0.0.0"
         netmask = netmask << 1
 
       while netmask != "0.0.0.0"
         netmask = netmask << 1
-        prefix = prefix + 1
+        prefix += 1
       end
 
       acl.address = "#{address.mask(prefix)}/#{prefix}"
       end
 
       acl.address = "#{address.mask(prefix)}/#{prefix}"