summaryrefslogtreecommitdiff
path: root/app/services/search
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-03-14 14:43:50 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-03-14 14:43:50 +0200
commit17a9ecf8cf6724613b38c08040bdb786ffe30718 (patch)
tree15e69e46eaba1a899b9027b496ab4dd731ab9515 /app/services/search
parente07b2f527fcaff6f2a998b0a74b0669389fbbbe6 (diff)
downloadgitlab-ce-17a9ecf8cf6724613b38c08040bdb786ffe30718.tar.gz
Remove confusing code
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/services/search')
-rw-r--r--app/services/search/global_service.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/app/services/search/global_service.rb b/app/services/search/global_service.rb
index 372d1bf7129..8a1fce17ce7 100644
--- a/app/services/search/global_service.rb
+++ b/app/services/search/global_service.rb
@@ -16,9 +16,7 @@ module Search
projects = projects.where(namespace_id: group.id) if group
project_ids = projects.pluck(:id)
- projects = projects.search(query)
-
- result[:projects] = projects.limit(20)
+ result[:projects] = projects.search(query).limit(20)
result[:merge_requests] = MergeRequest.in_projects(project_ids).search(query).order('updated_at DESC').limit(20)
result[:issues] = Issue.where(project_id: project_ids).search(query).order('updated_at DESC').limit(20)
result[:total_results] = %w(projects issues merge_requests).sum { |items| result[items.to_sym].size }