From f6ac0a727a8c48123832e7745a194e8023c9dddd Mon Sep 17 00:00:00 2001 From: edogawaconan Date: Sun, 27 Apr 2014 13:49:52 +0900 Subject: [PATCH] Nuke all votes with score less than 1. --- db/migrate/20140427041839_remove_non_votes.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 db/migrate/20140427041839_remove_non_votes.rb diff --git a/db/migrate/20140427041839_remove_non_votes.rb b/db/migrate/20140427041839_remove_non_votes.rb new file mode 100644 index 00000000..15587e79 --- /dev/null +++ b/db/migrate/20140427041839_remove_non_votes.rb @@ -0,0 +1,12 @@ +class RemoveNonVotes < ActiveRecord::Migration + class PostVote < ActiveRecord::Base + end + + def up + PostVote.where('score < 1').delete_all + end + + def down + ActiveRecord::IrreversibleMigration + end +end