app/models/solidus/elastic_product/index.rb
def __find_in_batches(options={}, &block)
        query = options.delete(:query)
        named_scope = options.delete(:scope)
        preprocess = options.delete(:preprocess)

        scope = State.serialized
        scope = scope.__send__(named_scope) if named_scope
        scope = scope.instance_exec(&query) if query

        scope.find_in_batches(options) do |batch|
          # State might've gotten reset in the meantime, skip those
          batch.delete_if { |state| state.json.blank? }
          yield (preprocess ? self.__send__(preprocess, batch) : batch)
        end
      end
# Fetch batches of records from the database (used by the import method)
#
Fetch batches of records from the database (used by the import method)
Fetch batches of records from the database ( used by the import method )
def __find_in_batches(options={}, &block)
        query = options.delete(:query)
        named_scope = options.delete(:scope)
        preprocess = options.delete(:preprocess)
        scope = State.serialized
        scope = scope.__send__(named_scope) if named_scope
        scope = scope.instance_exec(&query) if query
        scope.find_in_batches(options) do |batch|
          batch.delete_if { |state| state.json.blank? }
          yield (preprocess ? self.__send__(preprocess, batch) : batch)
        end
      end
def __find_in_batches ( options = { } , & block ) query = options . delete ( :query ) named_scope = options . delete ( :scope ) preprocess = options . delete ( :preprocess ) scope = State . serialized scope = scope . __send__ ( named_scope ) if named_scope scope = scope . instance_exec ( & query ) if query scope . find_in_batches ( options ) do | batch | batch . delete_if { | state | state . json . blank? } yield ( preprocess ? self . __send__ ( preprocess , batch ) : batch ) end end
Fetch batches of records from the database (used by the import method)
Fetch batches of records from the database ( used by the import method )
# State might've gotten reset in the meantime, skip those
options
block