Class: Esse::AsyncIndexing::ActiveRecordCallbacks::OnDestroy

Inherits:
Callback
  • Object
show all
Defined in:
lib/esse/async_indexing/active_record_callbacks/on_destroy.rb

Instance Attribute Summary

Attributes inherited from Callback

#service_name

Instance Method Summary collapse

Methods inherited from Callback

#initialize

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
# File 'lib/esse/async_indexing/active_record_callbacks/on_destroy.rb', line 6

def call(model)
  if (doc_id = resolve_document_id(model))
    repo.async_indexing_job_for(:delete).call(**options, service: service_name, repo: repo, operation: :delete, id: doc_id)
  end

  true
end