Module: Elasticsearch::Model::Extensions::PartialUpdating::Callbacks
- Defined in:
- lib/elasticsearch/model/extensions/partial_updating.rb
Class Method Summary collapse
Class Method Details
.included(base) ⇒ Object
143 144 145 146 147 148 149 |
# File 'lib/elasticsearch/model/extensions/partial_updating.rb', line 143 def self.included(base) base.class_eval do after_commit lambda { __elasticsearch__.index_document }, on: :create after_commit lambda { partially_update_document(*previous_changes.keys.map(&:intern)) }, on: :update, if: -> { previous_changes.size != 0 } after_commit lambda { __elasticsearch__.delete_document }, on: :destroy end end |