Class: Esse::ActiveRecord::Callbacks::IndexingOnCreate
- Inherits:
-
Esse::ActiveRecord::Callback
- Object
- Esse::ActiveRecord::Callback
- Esse::ActiveRecord::Callbacks::IndexingOnCreate
- Defined in:
- lib/esse/active_record/callbacks/indexing_on_create.rb
Instance Attribute Summary
Attributes inherited from Esse::ActiveRecord::Callback
#block_result, #options, #repo
Instance Method Summary collapse
Methods inherited from Esse::ActiveRecord::Callback
Constructor Details
This class inherits a constructor from Esse::ActiveRecord::Callback
Instance Method Details
#call(model) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/esse/active_record/callbacks/indexing_on_create.rb', line 6 def call(model) record = block_result || model document = repo.serialize(record) repo.index.index(document, **) if document && !document.ignore_on_index? true end |