From 627de7e0c768fc6dfa7d290f2af7ba89a44cec5b Mon Sep 17 00:00:00 2001 From: David Gageot Date: Thu, 14 Jun 2012 16:00:52 +0200 Subject: [PATCH] SONAR-3447 Users with accents are now shown in the "Assign To" list MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit In fact we completely ignore the accents so that e=é,a=à... --- .../main/webapp/WEB-INF/app/controllers/users_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/users_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/users_controller.rb index 30b06744cf3..755bf5a9bfc 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/users_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/users_controller.rb @@ -169,7 +169,8 @@ class UsersController < ApplicationController end def autocomplete - @users = User.find(:all, :conditions => ["UPPER(name) like ? AND active=?", params[:user_name_start].clone.upcase+"%", true]) + starts_with = Regexp.new(params[:user_name_start].parameterize.upcase + '(.*)') + @users = User.find(:all, :conditions => ["active=?", true]).to_a.select { |user| user.name.parameterize.upcase =~ starts_with } @char_count = params[:user_name_start].size render :partial => 'autocomplete' end -- 2.39.5