Module: Decidim::Searchable

Extended by:
ActiveSupport::Concern
Included in:
User
Defined in:
lib/decidim/searchable.rb

Overview

A concern with the features needed when you want a model to be searchable.

A Searchable should include this concern and declare its ‘searchable_fields`.

The indexing of Searchables is managed through:

  • after_create callback configurable via ‘index_on_create`.

  • after_update callback configurable via ‘index_on_update`.

  • searchable_resources are destroyed when the Searchable is destroyed.

Class Method Summary collapse

Class Method Details

.searchable_resourcesObject

Public: a Hash of searchable resources where keys are class names, and values

are the class instance for the resources.


23
24
25
# File 'lib/decidim/searchable.rb', line 23

def self.searchable_resources
  @searchable_resources
end