From 3cb395db156955d7191359d04be4828c3fb8fd18 Mon Sep 17 00:00:00 2001 From: Martin Artnik Date: Fri, 9 Jul 2021 10:49:11 +0200 Subject: [PATCH] Use where_attributes like in team search [SCI-5099] --- app/controllers/users/invitations_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/users/invitations_controller.rb b/app/controllers/users/invitations_controller.rb index 59c1216f7..606b9513b 100644 --- a/app/controllers/users/invitations_controller.rb +++ b/app/controllers/users/invitations_controller.rb @@ -166,7 +166,7 @@ module Users .where('user_teams.role': UserTeam.roles[:admin]) .distinct - teams = teams.where('name ILIKE ?', "%#{params[:query]}%") if params[:query].present? + teams = teams.where_attributes_like(:name, params[:query]) if params[:query].present? teams.select { |team| can_invite_team_users?(team) }