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