diff options
author | Razzeee <razzeee@gmail.com> | 2016-09-07 20:44:06 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-09-09 15:19:18 +0200 |
commit | 874ad681cd98616e560fb633e7c3867361faf46c (patch) | |
tree | 85206dacb54c5583b9cc47c967f6df6e926d3cf5 /lib/api/projects.rb | |
parent | 4bdcbc85987a03f21bc326905b581239f74f8b04 (diff) | |
download | gitlab-ce-874ad681cd98616e560fb633e7c3867361faf46c.tar.gz |
Search should compare only the lowercase versions of the project names
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r-- | lib/api/projects.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 4033f597859..b76be145a14 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -430,7 +430,7 @@ module API get "/search/:query" do ids = current_user.authorized_projects.map(&:id) visibility_levels = [ Gitlab::VisibilityLevel::INTERNAL, Gitlab::VisibilityLevel::PUBLIC ] - projects = Project.where("(id in (?) OR visibility_level in (?)) AND (name LIKE (?))", ids, visibility_levels, "%#{params[:query]}%") + projects = Project.where("(id in (?) OR visibility_level in (?)) AND (LOWER(name) LIKE LOWER((?)))", ids, visibility_levels, "%#{params[:query]}%") sort = params[:sort] == 'desc' ? 'desc' : 'asc' projects = case params["order_by"] |