diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 159650c38..e6c4ae330 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -290,7 +290,8 @@ class CoursesController < ApplicationController def apply_teachers search_str = params[:search].present? ? params[:search].strip : "" - @applications = CourseMessage.unhandled_join_course_requests_by_course(@course).joins(:user). + @applications = CourseMessage.unhandled_join_course_requests_by_course(@course). + joins("join users on course_messages.course_message_id=users.id"). where("LOWER(concat(users.lastname, users.firstname)) LIKE ?", "%#{search_str}%") @teacher_list_size = @course.teachers.size @applications_size = CourseMessage.unhandled_join_course_requests_by_course(@course).size