diff options
author | Dongqing Hu <sorra@outlook.com> | 2017-03-31 16:03:55 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-03-31 16:03:55 +0300 |
commit | b0ab0e4eff22ad35fcbad12c3feac6e8ac8b3822 (patch) | |
tree | 631e242fa529383e20921f8057f89be66f982f18 /app/services/search/snippet_service.rb | |
parent | 53b21c1e8e27a284a8691a73276204a85694eeb8 (diff) |
Refactor SearchController#show
Diffstat (limited to 'app/services/search/snippet_service.rb')
-rw-r--r-- | app/services/search/snippet_service.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/services/search/snippet_service.rb b/app/services/search/snippet_service.rb index 0b3e713e220..4f161beea4d 100644 --- a/app/services/search/snippet_service.rb +++ b/app/services/search/snippet_service.rb @@ -11,5 +11,9 @@ module Search Gitlab::SnippetSearchResults.new(snippets, params[:search]) end + + def scope + @scope ||= %w[snippet_titles].delete(params[:scope]) { 'snippet_blobs' } + end end end |