课堂数据同步

ecloud_sso
cxt 5 years ago
parent 9e6691703e
commit 41176e397c

@ -17,7 +17,7 @@ namespace :migrate_course_resource do
if atta.course_second_category.present?
target_category = CourseSecondCategory.find_by(name: atta.course_second_category.name, course_id: target_course.id, category_type: "attachment")
unless target_category.present?
course_module = Course.course_modules.find_by(module_type: "attachment")
course_module = target_course.course_modules.find_by(module_type: "attachment")
target_category = CourseSecondCategory.create(name: atta.course_second_category.name, course_id: target_course.id,
category_type: "attachment", course_module_id: course_module&.id,
position: course_module&.course_second_categories&.count.to_i + 1)

Loading…
Cancel
Save