socialforge/db/migrate/20150906091723_delete_anony...

16 lines
328 B
Ruby

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