socialforge/db/migrate/20150925060939_update_cours...

17 lines
354 B
Ruby

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