lib/superstore/scope/batches.rb in superstore-1.0.2 vs lib/superstore/scope/batches.rb in superstore-1.0.3
- old
+ new
@@ -9,10 +9,10 @@
def find_in_batches(options = {})
batch_size = options.delete(:batch_size) || 1000
start_key = nil
- scope = limit(batch_size + 1)
+ scope = limit(batch_size + 1).order(:id)
records = scope.to_a
while records.any?
if records.size > batch_size
next_record = records.pop