22 lines
495 B
Ruby
22 lines
495 B
Ruby
|
class AlterHomeworkEndTime < ActiveRecord::Migration
|
||
|
def up
|
||
|
homeworks = HomeworkCommon.where("id in (3229, 3234, 3235, 3236)");
|
||
|
unless homeworks.empty? || homeworks.nil?
|
||
|
homeworks.each do |hw|
|
||
|
hw.end_time = hw.end_time + 4
|
||
|
hm = hw.homework_detail_manual
|
||
|
hm.comment_status = 1
|
||
|
hw.student_works.each do |stu|
|
||
|
stu.late_penalty = 0
|
||
|
stu.save
|
||
|
end
|
||
|
hm.save
|
||
|
hw.save
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def down
|
||
|
end
|
||
|
end
|