Class: Chewy::Strategy::AtomicNoRefresh

Inherits:
Atomic
  • Object
show all
Defined in:
lib/chewy/strategy/atomic_no_refresh.rb

Overview

This strategy works like atomic but import objects with refresh=false parameter.

Chewy.strategy(:atomic_no_refresh) do User.all.map(&:save) # Does nothing here Post.all.map(&:save) # And here # It imports all the changed users and posts right here # before block leaving with bulk ES API, kinda optimization end

Instance Method Summary collapse

Methods inherited from Atomic

#initialize, #update

Methods inherited from Base

#name, #update, #update_chewy_indices

Constructor Details

This class inherits a constructor from Chewy::Strategy::Atomic

Instance Method Details

#leaveObject



13
14
15
# File 'lib/chewy/strategy/atomic_no_refresh.rb', line 13

def leave
  @stash.all? { |type, ids| type.import!(ids, refresh: false) }
end