Class: Esse::AsyncIndexing::ActiveRecordCallbacks::OnCreate

Inherits:
Callback
  • Object
show all
Defined in:
lib/esse/async_indexing/active_record_callbacks/on_create.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_create.rb', line 6

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

  true
end