diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/snippet_search_results.rb | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/lib/gitlab/snippet_search_results.rb b/lib/gitlab/snippet_search_results.rb index e955ccd35da..7fcae04c14f 100644 --- a/lib/gitlab/snippet_search_results.rb +++ b/lib/gitlab/snippet_search_results.rb @@ -12,35 +12,17 @@ module Gitlab end def objects(scope, page = nil) - case scope - when 'snippet_titles' - paginated_objects(snippet_titles, page) - when 'snippet_blobs' - paginated_objects(snippet_blobs, page) - else - super(scope, nil, false) - end + paginated_objects(snippet_titles, page) end def formatted_count(scope) - case scope - when 'snippet_titles' - formatted_limited_count(limited_snippet_titles_count) - when 'snippet_blobs' - formatted_limited_count(limited_snippet_blobs_count) - else - super - end + formatted_limited_count(limited_snippet_titles_count) end def limited_snippet_titles_count @limited_snippet_titles_count ||= limited_count(snippet_titles) end - def limited_snippet_blobs_count - @limited_snippet_blobs_count ||= limited_count(snippet_blobs) - end - private # rubocop: disable CodeReuse/ActiveRecord @@ -56,14 +38,6 @@ module Gitlab snippets.search(query) end - def snippet_blobs - snippets.search_code(query) - end - - def default_scope - 'snippet_blobs' - end - def paginated_objects(relation, page) relation.page(page).per(per_page) end |