Module: Elasticsearch::Model::Indexing::InstanceMethods

Includes:
ActiverecordReindex::ReflectionReindex
Defined in:
lib/activerecord_reindex/update_document_monkey_patch.rb

Instance Method Summary collapse

Methods included from ActiverecordReindex::ReflectionReindex

#update_document_hook

Instance Method Details

#original_update_documentObject



12
# File 'lib/activerecord_reindex/update_document_monkey_patch.rb', line 12

alias original_update_document update_document

#update_document(*args, request_record: nil) ⇒ Object

monkey patch update_document method from elasticsearch gem use super and hook on reindex to reindex associations

for why request_record needed here and what it is see sync_adapter.rb



20
21
22
23
24
25
# File 'lib/activerecord_reindex/update_document_monkey_patch.rb', line 20

def update_document(*args, request_record: nil)
  # defined in ActiverecordReindex::ReflectionReindex
  update_document_hook(request_record)

  original_update_document(*args)
end