summaryrefslogtreecommitdiff
path: root/app/services/search
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2016-03-01 18:01:09 +0100
committerRobert Speicher <rspeicher@gmail.com>2016-03-11 15:25:22 -0500
commit42fde69d39234368f8252febc9bf6ca3eca6f275 (patch)
treea0e1a9cf6808195653d4f8e383862a7500c6e5e5 /app/services/search
parent013542965c2b6d84d28aab4823e5400897610087 (diff)
downloadgitlab-ce-42fde69d39234368f8252febc9bf6ca3eca6f275.tar.gz
Refactor Gitlab::SnippetSearchResults
This removes the need for plucking snippet IDs into memory.
Diffstat (limited to 'app/services/search')
-rw-r--r--app/services/search/snippet_service.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/services/search/snippet_service.rb b/app/services/search/snippet_service.rb
index 8ca0877321d..0b3e713e220 100644
--- a/app/services/search/snippet_service.rb
+++ b/app/services/search/snippet_service.rb
@@ -7,8 +7,9 @@ module Search
end
def execute
- snippet_ids = Snippet.accessible_to(current_user).pluck(:id)
- Gitlab::SnippetSearchResults.new(snippet_ids, params[:search])
+ snippets = Snippet.accessible_to(current_user)
+
+ Gitlab::SnippetSearchResults.new(snippets, params[:search])
end
end
end