socialforge/db/migrate/20151109080256_alter_user_a...

17 lines
344 B
Ruby

class AlterUserActivitiesUpdate < ActiveRecord::Migration
def up
count = UserActivity.all.count / 30 + 2
transaction do
for i in 1 ... count do i
UserActivity.page(i).per(30).each do |activity|
activity.updated_at = activity.created_at
activity.save
end
end
end
end
def down
end
end