From: David Gageot Date: Thu, 14 Jun 2012 14:00:52 +0000 (+0200) Subject: SONAR-3447 Users with accents are now shown in the "Assign To" list X-Git-Tag: 3.2~325 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=627de7e0c768fc6dfa7d290f2af7ba89a44cec5b;p=sonarqube.git SONAR-3447 Users with accents are now shown in the "Assign To" list In fact we completely ignore the accents so that e=é,a=à... --- 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