修改作业数据迁移
This commit is contained in:
parent
0480405afb
commit
f80e1f811a
|
@ -4,10 +4,9 @@ class RenameProjectIdToHomeworkForCourses < ActiveRecord::Migration
|
|||
|
||||
# 作业数据迁移
|
||||
HomeworkForCourse.all.each do |work|
|
||||
project = Project.find_by_id(work.project_id)
|
||||
project = Project.find_by_id(work.course_id)
|
||||
if project && project.project_type == 1
|
||||
work.course_id = project.course_extra.id
|
||||
work.project_id = -1
|
||||
work.save
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue