Class: ActiverecordReindex::AsyncAdapter::UpdateJob

Inherits:
ActiveJob::Base
  • Object
show all
Defined in:
lib/activerecord_reindex/async_adapter.rb

Overview

Job wrapper. Queues elastic_index queue for each reindex

Instance Method Summary collapse

Instance Method Details

#perform(klass, id, request_record_klass, request_record_id) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/activerecord_reindex/async_adapter.rb', line 21

def perform(klass, id, request_record_klass, request_record_id)
  klass = klass.constantize

  request_record = request_record_klass.constantize.find(request_record_id)

  klass.find(id).__elasticsearch__.update_document(request_record: request_record)
end