diff --git a/db/migrate/20150906083453_delete_anonymous_jour.rb b/db/migrate/20150906083453_delete_anonymous_jour.rb index 5361eb5e1..52e5454e5 100644 --- a/db/migrate/20150906083453_delete_anonymous_jour.rb +++ b/db/migrate/20150906083453_delete_anonymous_jour.rb @@ -1,13 +1,6 @@ class DeleteAnonymousJour < ActiveRecord::Migration def up - jour_count = Journal.all.count / 30 + 2 - transaction do - for i in 1 ... jour_count do i - Journal.page(i).per(30).each do |jour| - jour.destroy if jour.user_id == 2 - end - end - end + Journal.where("user_id = 2").destroy_all end def down diff --git a/db/migrate/20150906090419_delete_anonymous_feedback.rb b/db/migrate/20150906090419_delete_anonymous_feedback.rb index ebb15e9d0..771fd4856 100644 --- a/db/migrate/20150906090419_delete_anonymous_feedback.rb +++ b/db/migrate/20150906090419_delete_anonymous_feedback.rb @@ -1,13 +1,6 @@ class DeleteAnonymousFeedback < ActiveRecord::Migration def up - jour_count = JournalsForMessage.all.count / 30 + 2 - transaction do - for i in 1 ... jour_count do i - JournalsForMessage.page(i).per(30).each do |jour| - jour.destroy if jour.user_id.to_s == "2" - end - end - end + JournalsForMessage.where("user_id = 2").destroy_all end def down diff --git a/db/migrate/20150906091723_delete_anonymous_message.rb b/db/migrate/20150906091723_delete_anonymous_message.rb index d128f2aff..dc60bc5e4 100644 --- a/db/migrate/20150906091723_delete_anonymous_message.rb +++ b/db/migrate/20150906091723_delete_anonymous_message.rb @@ -1,13 +1,6 @@ class DeleteAnonymousMessage < ActiveRecord::Migration def up - message_count = Message.all.count / 30 + 2 - transaction do - for i in 1 ... message_count do i - Message.page(i).per(30).each do |message| - message.destroy if jour.author_id.to_s == "2" - end - end - end + Message.where("author_id = 2").destroy_all end def down