Module: Redmine::Search

Defined in:
lib/redmine/search.rb

Defined Under Namespace

Modules: Controller Classes: Fetcher

Constant Summary collapse

@@available_search_types =
[]

Class Method Summary collapse

Class Method Details

.cache_storeObject

Returns the cache store for search results Can be configured with config.redmine_search_cache_store= in config/application.rb


39
40
41
42
43
44
45
46
47
# File 'lib/redmine/search.rb', line 39

def cache_store
  @@cache_store ||= begin
    # if config.search_cache_store was not previously set, a no method error would be raised
    config = Rails.application.config.redmine_search_cache_store rescue :memory_store
    if config
      ActiveSupport::Cache.lookup_store config
    end
  end
end

.map {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:


27
28
29
# File 'lib/redmine/search.rb', line 27

def map(&block)
  yield self
end

.register(search_type, options = {}) ⇒ Object

Registers a search provider


32
33
34
35
# File 'lib/redmine/search.rb', line 32

def register(search_type, options={})
  search_type = search_type.to_s
  @@available_search_types << search_type unless @@available_search_types.include?(search_type)
end