Module: Redmine::Search

Defined in:
lib/redmine/search.rb

Defined Under Namespace

Modules: Controller Classes: Fetcher

Constant Summary

@@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



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

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:



25
26
27
# File 'lib/redmine/search.rb', line 25

def map(&block)
  yield self
end

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

Registers a search provider



30
31
32
33
# File 'lib/redmine/search.rb', line 30

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