diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-01-30 04:10:48 -0800 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-01-30 04:10:48 -0800 |
commit | 7f5466d58299db35a3d320e0b526001ae3be11a7 (patch) | |
tree | 93216f765177f068ed882994582af596a50980d7 /activerecord/lib | |
parent | 02f9f3314244513fce0a94acef08318d67d6707f (diff) | |
parent | 642106e277334e75ff1ae8d8a03f5fef37cf0671 (diff) | |
download | rails-7f5466d58299db35a3d320e0b526001ae3be11a7.tar.gz rails-7f5466d58299db35a3d320e0b526001ae3be11a7.tar.bz2 rails-7f5466d58299db35a3d320e0b526001ae3be11a7.zip |
Merge pull request #13878 from marcandre/leave_my_options_alone
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 |