From f57df53b275317797f6f1a15395175eb48021f13 Mon Sep 17 00:00:00 2001 From: Daniela Soares Feitosa Date: Tue, 22 Feb 2011 18:31:28 -0300 Subject: [PATCH] Added migration to fix broken records --- db/migrate/20110222211802_remove_action_tracker_records_with_nil_users.rb | 10 ++++++++++ 1 file changed, 10 insertions(+), 0 deletions(-) create mode 100644 db/migrate/20110222211802_remove_action_tracker_records_with_nil_users.rb diff --git a/db/migrate/20110222211802_remove_action_tracker_records_with_nil_users.rb b/db/migrate/20110222211802_remove_action_tracker_records_with_nil_users.rb new file mode 100644 index 0000000..9eeb89b --- /dev/null +++ b/db/migrate/20110222211802_remove_action_tracker_records_with_nil_users.rb @@ -0,0 +1,10 @@ +class RemoveActionTrackerRecordsWithNilUsers < ActiveRecord::Migration + # This migration is a copy of 20110127174236_remove_action_tracker_record_with_nil_users.rb + def self.up + ActionTracker::Record.all.map {|record| record.destroy if record.user.nil?} + end + + def self.down + say "this migration can't be reverted" + end +end -- libgit2 0.21.2