Class: Esse::AsyncIndexing::ActiveRecordCallbacks::OnUpdate
- Inherits:
-
Callback
- Object
- Esse::ActiveRecord::Callback
- Callback
- Esse::AsyncIndexing::ActiveRecordCallbacks::OnUpdate
- Defined in:
- lib/esse/async_indexing/active_record_callbacks/on_update.rb
Instance Attribute Summary
Attributes inherited from Callback
Instance Method Summary collapse
Methods inherited from Callback
Constructor Details
This class inherits a constructor from Esse::AsyncIndexing::ActiveRecordCallbacks::Callback
Instance Method Details
#call(model) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/esse/async_indexing/active_record_callbacks/on_update.rb', line 6 def call(model) doc_id = resolve_document_id(model) return true unless doc_id kwargs = {service: service_name, repo: repo, id: doc_id} if with == :update repo.async_indexing_job_for(:update).call(**, **kwargs, operation: :update) else repo.async_indexing_job_for(:index).call(**, **kwargs, operation: :index) end true end |