From 17a9ecf8cf6724613b38c08040bdb786ffe30718 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 14 Mar 2014 14:43:50 +0200 Subject: Remove confusing code Signed-off-by: Dmitriy Zaporozhets --- app/services/search/global_service.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'app/services/search') 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 } -- cgit v1.2.1