迁移文件
This commit is contained in:
parent
d4a35b94f6
commit
2d95885345
|
@ -6,8 +6,8 @@ class MergeTwoHomeworks < ActiveRecord::Migration
|
||||||
work.update_column('homework_common_id', 3463)
|
work.update_column('homework_common_id', 3463)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
homework = HomeworkCommon.find 3387
|
#homework = HomeworkCommon.find 3387
|
||||||
homework.destroy if homework
|
#homework.destroy if homework
|
||||||
stu_works = StudentWork.where("homework_common_id = 3387")
|
stu_works = StudentWork.where("homework_common_id = 3387")
|
||||||
stu_work_ids = stu_works.empty? ? "(-1)" : "(" + stu_works.map{|work| work.id}.join(',') + ")"
|
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}")
|
stu_work_tests = StudentWorkTest.where("student_work_id in #{stu_work_ids}")
|
||||||
|
|
Loading…
Reference in New Issue