diff options
author | Marc-Andre Lafortune <github@marc-andre.ca> | 2014-01-29 15:02:13 -0500 |
---|---|---|
committer | Marc-Andre Lafortune <github@marc-andre.ca> | 2014-01-29 23:52:41 -0500 |
commit | 642106e277334e75ff1ae8d8a03f5fef37cf0671 (patch) | |
tree | f269f2cfc5abf05dd7723e388201ee6a06d67d11 /activerecord/lib | |
parent | fec1028d088294c30f568e46db3bbd054a9330ff (diff) | |
download | rails-642106e277334e75ff1ae8d8a03f5fef37cf0671.tar.gz rails-642106e277334e75ff1ae8d8a03f5fef37cf0671.tar.bz2 rails-642106e277334e75ff1ae8d8a03f5fef37cf0671.zip |
find_in_batches should not mutate its argument
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/relation/batches.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/relation/batches.rb b/activerecord/lib/active_record/relation/batches.rb index dfcfef2ad2..666cef80a9 100644 --- a/activerecord/lib/active_record/relation/batches.rb +++ b/activerecord/lib/active_record/relation/batches.rb @@ -104,8 +104,8 @@ module ActiveRecord logger.warn("Scoped order and limit are ignored, it's forced to be batch order and batch size") end - start = options.delete(:start) - batch_size = options.delete(:batch_size) || 1000 + start = options[:start] + batch_size = options[:batch_size] || 1000 relation = relation.reorder(batch_order).limit(batch_size) records = start ? relation.where(table[primary_key].gteq(start)).to_a : relation.to_a |