end
end
-class MergeAclAddressAndMask < ActiveRecord::Migration[5.0]
+class MergeAclAddressAndMask < ActiveRecord::Migration[4.2]
+ class Acl < ApplicationRecord
+ end
+
def up
Acl.find_each do |acl|
address = IPAddr.new(acl.address)
prefix = 0
while netmask != "0.0.0.0"
- netmask = netmask << 1
+ netmask <<= 1
prefix += 1
end