|
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
|
|
end
|
|
|
|
def down
|
|
end
|
|
end
|