Permalink
Browse files

Remove empty IP addresses

  • Loading branch information...
1 parent 738da72 commit 70892a14a37b2d5fbf69bfaff0bb3eb03795b3bf @jbbarth jbbarth committed Jun 24, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 db/migrate/20120624091916_cleanup_empty_ip_addresses.rb
@@ -0,0 +1,12 @@
+class CleanupEmptyIpAddresses < Mongoid::Migration
+ def self.up
+ Ipaddress.where(address: nil).each(&:destroy)
+ Server.all.each do |server|
+ server.update_main_ipaddress
+ server.save
+ end
+ end
+
+ def self.down
+ end
+end

0 comments on commit 70892a1

Please sign in to comment.