Module: ActiverecordReindex::ReindexHook

Defined in:
lib/activerecord_reindex/reindex_hook.rb

Overview

Since recursive reindexing can go through models that does not exist in elastic and not inherited from Elsaticsearch::Model they will not have __elasticsearch__.update_document method those will stop recursive reindexing chain in its way To prevent this we emulate __elasticsearch__.update_document on them and continue reindex chain as is, without reindexing this records

Instance Method Summary collapse

Instance Method Details

#__elasticsearch__Object



12
13
14
# File 'lib/activerecord_reindex/reindex_hook.rb', line 12

def __elasticsearch__
  @__elasticsearch__ ||= ActiverecordReindex::ElasticsearchProxy.new(self.class)
end