X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/aa1fb6dbb8c2e71b8ce8c231ae1272a2dfebd75a..84681ff8683bb7c8f410b2dc13ca5b8695e413a4:/db/migrate/20120208122334_merge_acl_address_and_mask.rb?ds=sidebyside diff --git a/db/migrate/20120208122334_merge_acl_address_and_mask.rb b/db/migrate/20120208122334_merge_acl_address_and_mask.rb index 1e67f46dd..5cac10740 100644 --- a/db/migrate/20120208122334_merge_acl_address_and_mask.rb +++ b/db/migrate/20120208122334_merge_acl_address_and_mask.rb @@ -10,7 +10,10 @@ class IPAddr 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) @@ -18,7 +21,7 @@ class MergeAclAddressAndMask < ActiveRecord::Migration[5.0] prefix = 0 while netmask != "0.0.0.0" - netmask = netmask << 1 + netmask <<= 1 prefix += 1 end