Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-11-24 14:24:24 +0300
committerDouwe Maan <douwe@selenight.nl>2017-11-27 13:29:40 +0300
commitda42dfb3cf4a2fb0cdcc1a3b41438516a0bed0e5 (patch)
tree1dc5014e27ce049e47e8670b83b79e0c49bb96b9 /app/models/namespace.rb
parentd4eea275310867eccc927d0e92a1d19a165f0668 (diff)
Use fuzzy search with minimum length of 3 characters where appropriate
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r--app/models/namespace.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb
index 15bc7032a43..fa76729a702 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -87,10 +87,7 @@ class Namespace < ActiveRecord::Base
#
# Returns an ActiveRecord::Relation
def search(query)
- t = arel_table
- pattern = to_pattern(query)
-
- where(t[:name].matches(pattern).or(t[:path].matches(pattern)))
+ fuzzy_search(query, [:name, :path])
end
def clean_path(path)