module Elasticsearch::Model::TransactionalCallbacks::Relation

Override .update_all and .delete_all of ActiveRecord::Relation to batch update/delete the index if the resources in question have a coresponding elasticsearch index

This module are automatically included into ActiveRecord::Relation inside of railtie

Public Instance Methods

delete_all() click to toggle source
Calls superclass method
# File lib/elasticsearch/model/transactional_callbacks/relation.rb, line 23
def delete_all
  Manager.capture do
    Manager.queue.push_all(:delete, self)

    super
  end
end
update_all(*arguments) click to toggle source
Calls superclass method
# File lib/elasticsearch/model/transactional_callbacks/relation.rb, line 15
def update_all(*arguments)
  Manager.capture do
    Manager.queue.push_all(:update, self)

    super(*arguments)
  end
end