@ -146,7 +146,7 @@ class Course < ApplicationRecord
def teacher_group(user_id)
data =
if teacher_course_groups.exists?(user_id: user_id)
teacher_course_groups.joins(:course_group).where(user_id: user_id)
teacher_course_groups.joins(:course_group).where(user_id: user_id).distinct
.pluck('course_groups.id', 'course_groups.name')
else
course_groups.pluck(:id, :name)