diff --git a/app/services/members/list_service.rb b/app/services/members/list_service.rb index 8886c1f79..d5033c645 100644 --- a/app/services/members/list_service.rb +++ b/app/services/members/list_service.rb @@ -26,7 +26,7 @@ class Members::ListService # ILIKE => PostgreSQL case-insensitive LIKE if params[:search].size.positive? - @query = @query.where('username ILIKE :search OR ' \ + @query = @query.where('users.username ILIKE :search OR ' \ 'profiles.first_name ILIKE :search OR ' \ 'profiles.last_name ILIKE :search OR ' \ 'profiles.phone ILIKE :search OR ' \ @@ -85,7 +85,7 @@ class Members::ListService order_key = case order_key when 'username' - 'username' + 'users.username' when 'last_name' 'profiles.last_name' when 'first_name'