Module: SearchConfigHelper

Defined in:
public/app/helpers/search_config_helper.rb

Class Method Summary collapse

Class Method Details

.default_search_all_records?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'public/app/helpers/search_config_helper.rb', line 15

def self.default_search_all_records?
  default_search_scope == 'all_record_types'
end

.default_search_scopeObject



2
3
4
5
6
7
8
9
10
11
12
13
# File 'public/app/helpers/search_config_helper.rb', line 2

def self.default_search_scope
  scope = AppConfig[:search_default_scope]

  # Validate the scope and default to all_record_types if invalid
  valid_scopes = ['all_record_types', 'collections_only']
  unless valid_scopes.include?(scope)
    Rails.logger.warn("Invalid search_default_scope setting: '#{scope}'. Using 'all_record_types' instead.")
    scope = 'all_record_types'
  end

  scope
end