diff --git a/app/queries/admins/laboratory_query.rb b/app/queries/admins/laboratory_query.rb index 21020216b..8667bb8ed 100644 --- a/app/queries/admins/laboratory_query.rb +++ b/app/queries/admins/laboratory_query.rb @@ -15,7 +15,7 @@ class Admins::LaboratoryQuery < ApplicationQuery keyword = strip_param(:keyword) if keyword.present? like_sql = 'schools.name LIKE :keyword OR laboratories.identifier LIKE :keyword' - laboratories = laboratories.joins(:school).where(like_sql, keyword: "%#{keyword}%") + laboratories = laboratories.left_joins(:school).where(like_sql, keyword: "%#{keyword}%") end custom_sort laboratories, params[:sort_by], params[:sort_direction]