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

Defined in:
lib/activerecord_reindex/update_document_monkey_patch.rb

Instance Method Summary collapse

Instance Method Details

#original_update_documentObject



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

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



13
14
15
16
17
18
# File 'lib/activerecord_reindex/update_document_monkey_patch.rb', line 13

def update_document(*args, request_record: nil)
  if _active_record_model?(self.class)
    _reindex_reflections(self.class, request_record)
  end
  original_update_document(*args)
end