summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorHiroyuki Sato <sathiroyuki@gmail.com>2017-08-23 01:51:53 +0900
committerHiroyuki Sato <sathiroyuki@gmail.com>2017-08-25 18:41:43 +0900
commit9e203582b367a1b84035572261a79b62e22bfeaa (patch)
tree34c594804a5d68eb3fbd4eee90bc3dfc9b134c46 /app
parent539ed0a6375d5bb6d734e688b801373e4b8006f9 (diff)
downloadgitlab-ce-9e203582b367a1b84035572261a79b62e22bfeaa.tar.gz
Improve AutocompleteController#user.json performance
Diffstat (limited to 'app')
-rw-r--r--app/models/user.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index fbd08bc4d0a..e5a84ce4080 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -303,7 +303,7 @@ class User < ActiveRecord::Base
# Returns an ActiveRecord::Relation.
def search(query)
table = arel_table
- pattern = "%#{query}%"
+ pattern = Gitlab::SQL::Pattern.new(query).to_sql
order = <<~SQL
CASE