|
|
|
@ -231,7 +231,7 @@ namespace :migrate_course_resource do
|
|
|
|
|
|
|
|
|
|
group.teacher_course_groups.each do |teacher_group|
|
|
|
|
|
member = CourseMember.find_by(course_id: target_course.id, user_id: teacher_group.user_id, role: %i[CREATOR PROFESSOR ASSISTANT_PROFESSOR])
|
|
|
|
|
if member.present? && member.teacher_course_groups.where(course_group_id: new_group.id).exists?
|
|
|
|
|
if member.present? && !member.teacher_course_groups.where(course_group_id: new_group.id).exists?
|
|
|
|
|
TeacherCourseGroup.create!(course_group_id: new_group.id, course_id: target_course.id, course_member_id: member&.id, user_id: member&.user_id)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|