Module: Plotline::Concerns::Searchable

Extended by:
ActiveSupport::Concern
Included in:
Entry
Defined in:
app/models/plotline/concerns/searchable.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#search_attributesObject



26
27
28
29
30
# File 'app/models/plotline/concerns/searchable.rb', line 26

def search_attributes
  self.class.searchable_attributes.each_with_object({}) do |attr_name, search_data|
    search_data[attr_name] = send(attr_name)
  end
end

#update_search_indexObject



32
33
34
# File 'app/models/plotline/concerns/searchable.rb', line 32

def update_search_index
  Plotline::EntrySearchData.index_entry_data(id, search_attributes)
end