Skip to content

Commit

Permalink
Add batch_size(batch_size) to __find_in_batches (Mongoid)
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvain-8422 committed Jul 11, 2022
1 parent b66fe71 commit ef8985e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def __find_in_batches(options={}, &block)
scope = scope.send(named_scope) if named_scope
scope = query.is_a?(Proc) ? scope.class_exec(&query) : scope.where(query) if query

scope.no_timeout.each_slice(batch_size) do |items|
scope.no_timeout.batch_size(batch_size).each_slice(batch_size) do |items|
yield (preprocess ? self.__send__(preprocess, items) : items)
end
end
Expand Down

0 comments on commit ef8985e

Please sign in to comment.