迁移文件

This commit is contained in:
cxt 2016-05-11 15:00:26 +08:00
parent d4a35b94f6
commit 2d95885345
1 changed files with 2 additions and 2 deletions

View File

@ -6,8 +6,8 @@ class MergeTwoHomeworks < ActiveRecord::Migration
work.update_column('homework_common_id', 3463)
end
end
homework = HomeworkCommon.find 3387
homework.destroy if homework
#homework = HomeworkCommon.find 3387
#homework.destroy if homework
stu_works = StudentWork.where("homework_common_id = 3387")
stu_work_ids = stu_works.empty? ? "(-1)" : "(" + stu_works.map{|work| work.id}.join(',') + ")"
stu_work_tests = StudentWorkTest.where("student_work_id in #{stu_work_ids}")