Class: Esse::ActiveRecord::Callbacks::IndexingOnDestroy
- Inherits:
-
Esse::ActiveRecord::Callback
- Object
- Esse::ActiveRecord::Callback
- Esse::ActiveRecord::Callbacks::IndexingOnDestroy
- Defined in:
- lib/esse/active_record/callbacks/indexing_on_destroy.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 12 13 |
# File 'lib/esse/active_record/callbacks/indexing_on_destroy.rb', line 6 def call(model) record = block_result || model document = repo.serialize(record) repo.index.delete(document, **) if document && !document.ignore_on_delete? true rescue Esse::Transport::NotFoundError true end |