parent
beb84c9bfa
commit
17a675702a
@ -1,14 +0,0 @@
|
||||
class UpdateExeriseUserEndAt < ActiveRecord::Migration
|
||||
def up
|
||||
exercise = Exercise.where(:id => 123).first
|
||||
exercise.exercise_group_settings.each do |group|
|
||||
if group.end_time.present? && group.end_time < Time.now
|
||||
user_ids = exercise.course.members.where(:course_group_id => group.course_group_id).map(&:user_id)
|
||||
exercise.exercise_users.where(:commit_status => 1, :user_id => user_ids).update_all(:end_at => group.end_time)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
Loading…
Reference in new issue