diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2016-03-01 20:01:09 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-03-11 23:25:22 +0300 |
commit | 42fde69d39234368f8252febc9bf6ca3eca6f275 (patch) | |
tree | a0e1a9cf6808195653d4f8e383862a7500c6e5e5 /app/services/search/snippet_service.rb | |
parent | 013542965c2b6d84d28aab4823e5400897610087 (diff) |
Refactor Gitlab::SnippetSearchResults
This removes the need for plucking snippet IDs into memory.
Diffstat (limited to 'app/services/search/snippet_service.rb')
-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 |