cirandas.net

ref: master

db/migrate/20130429214630_destroy_inconsistent_abuse_complaints.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
class DestroyInconsistentAbuseComplaints < ActiveRecord::Migration
  def self.up
    AbuseComplaint.find_each do |ac|
      if ac.reported.nil?
        ac.destroy
      end
    end
  end

  def self.down
    raise ActiveRecord::IrreversibleMigration
  end
end