作业列表未登录访问报错

dev_new_shixunsrepository
cxt 5 years ago
parent 022751735b
commit ea8aeafdb7

@ -260,7 +260,7 @@ class Course < ApplicationRecord
member = user.is_a?(CourseMember) ? user : course_member(user&.id) member = user.is_a?(CourseMember) ? user : course_member(user&.id)
group_ids = if member.present? group_ids = if member.present?
member.teacher_course_groups.size > 0 ? member.teacher_course_groups.pluck(:course_group_id) : course_groups.pluck(:id) member.teacher_course_groups.size > 0 ? member.teacher_course_groups.pluck(:course_group_id) : course_groups.pluck(:id)
elsif user.admin_or_business? elsif user&.admin_or_business?
course_groups.pluck(:id) course_groups.pluck(:id)
else else
[] []

Loading…
Cancel
Save