Commit 17a9ecf8 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Remove confusing code

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent e07b2f52
...@@ -16,9 +16,7 @@ module Search ...@@ -16,9 +16,7 @@ module Search
projects = projects.where(namespace_id: group.id) if group projects = projects.where(namespace_id: group.id) if group
project_ids = projects.pluck(:id) project_ids = projects.pluck(:id)
projects = projects.search(query) result[:projects] = projects.search(query).limit(20)
result[:projects] = projects.limit(20)
result[:merge_requests] = MergeRequest.in_projects(project_ids).search(query).order('updated_at DESC').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[: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 } result[:total_results] = %w(projects issues merge_requests).sum { |items| result[items.to_sym].size }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment