Module: Search::Scope
- Defined in:
- lib/search/scope.rb
Constant Summary collapse
- ALWAYS_ALLOWED_SCOPES =
%w[projects milestones].freeze
- GLOBAL_SCOPES =
%w[issues merge_requests snippet_titles users].freeze
- PROJECT_SCOPES =
ALWAYS_ALLOWED_SCOPES + GLOBAL_SCOPES + %w[blobs wiki_blobs commits notes].freeze
- SCOPE_TO_SETTING =
{ blobs: :code, wiki_blobs: :wiki }.freeze
Class Method Summary collapse
Class Method Details
.global ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/search/scope.rb', line 15 def global enabled_global_scopes = global_scopes.select do |scope| setting_name = SCOPE_TO_SETTING[scope.to_sym] || scope ::Gitlab::CurrentSettings.public_send(:"global_search_#{setting_name}_enabled") # rubocop:disable GitlabSecurity/PublicSend -- needed for application settings end ALWAYS_ALLOWED_SCOPES + enabled_global_scopes end |
.group ⇒ Object
24 25 26 |
# File 'lib/search/scope.rb', line 24 def group ALWAYS_ALLOWED_SCOPES + global_scopes end |
.project ⇒ Object
28 29 30 |
# File 'lib/search/scope.rb', line 28 def project ALWAYS_ALLOWED_SCOPES + global_scopes + PROJECT_SCOPES end |