diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2016-03-01 18:01:09 +0100 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-03-11 15:25:22 -0500 |
commit | 42fde69d39234368f8252febc9bf6ca3eca6f275 (patch) | |
tree | a0e1a9cf6808195653d4f8e383862a7500c6e5e5 /app/services/search | |
parent | 013542965c2b6d84d28aab4823e5400897610087 (diff) | |
download | gitlab-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.rb | 5 |
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 |