Class: Gitlab::SnippetSearchResults

Inherits:
SearchResults show all
Includes:
SnippetsHelper
Defined in:
lib/gitlab/snippet_search_results.rb

Constant Summary

Constants inherited from SearchResults

Gitlab::SearchResults::COUNT_LIMIT, Gitlab::SearchResults::COUNT_LIMIT_MESSAGE, Gitlab::SearchResults::DEFAULT_PAGE, Gitlab::SearchResults::DEFAULT_PER_PAGE, Gitlab::SearchResults::SCOPE_ONLY_SORT

Instance Attribute Summary

Attributes inherited from SearchResults

#current_user, #default_project_filter, #filters, #limit_projects, #order_by, #query, #sort

Instance Method Summary collapse

Methods included from SnippetsHelper

#embedded_copy_snippet_button, #embedded_raw_snippet_button, #embedded_snippet_download_button, #project_snippets_award_api_path, #snippet_badge, #snippet_badge_attributes, #snippet_file_count, #snippet_report_abuse_path, #snippets_upload_path, #subject_snippets_path

Methods inherited from SearchResults

#aggregations, #count_limit, #error, #failed?, #formatted_limited_count, #highlight_map, #initialize, #limited_issues_count, #limited_merge_requests_count, #limited_milestones_count, #limited_projects_count, #limited_users_count, #users

Constructor Details

This class inherits a constructor from Gitlab::SearchResults

Instance Method Details

#formatted_count(scope) ⇒ Object



11
12
13
# File 'lib/gitlab/snippet_search_results.rb', line 11

def formatted_count(scope)
  formatted_limited_count(limited_snippet_titles_count)
end

#limited_snippet_titles_countObject



15
16
17
# File 'lib/gitlab/snippet_search_results.rb', line 15

def limited_snippet_titles_count
  @limited_snippet_titles_count ||= limited_count(snippet_titles)
end

#objects(scope, page: nil, per_page: DEFAULT_PER_PAGE, preload_method: nil) ⇒ Object



7
8
9
# File 'lib/gitlab/snippet_search_results.rb', line 7

def objects(scope, page: nil, per_page: DEFAULT_PER_PAGE, preload_method: nil)
  paginated_objects(snippet_titles, page, per_page)
end