diff options
author | Arun Agrawal <arun@fromjaipur.com> | 2011-09-05 00:12:57 +0530 |
---|---|---|
committer | Arun Agrawal <arun@fromjaipur.com> | 2011-09-05 00:12:57 +0530 |
commit | 9066e3402548d365dc7cf2abda8e7cd64370675c (patch) | |
tree | 6dda8a6eb139f8c223067e543628cc7e9b0b6e87 /activerecord/lib | |
parent | e865d125431424562b5e252ed151f6bae8dd5e8f (diff) | |
download | rails-9066e3402548d365dc7cf2abda8e7cd64370675c.tar.gz rails-9066e3402548d365dc7cf2abda8e7cd64370675c.tar.bz2 rails-9066e3402548d365dc7cf2abda8e7cd64370675c.zip |
We need to recorder here. Need to drop the order from default scope.
Fixes #2832
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/relation/batches.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/batches.rb b/activerecord/lib/active_record/relation/batches.rb index ec1176e3dd..2fd89882ff 100644 --- a/activerecord/lib/active_record/relation/batches.rb +++ b/activerecord/lib/active_record/relation/batches.rb @@ -62,7 +62,7 @@ module ActiveRecord start = options.delete(:start).to_i batch_size = options.delete(:batch_size) || 1000 - relation = relation.except(:order).order(batch_order).limit(batch_size) + relation = relation.reorder(batch_order).limit(batch_size) records = relation.where(table[primary_key].gteq(start)).all while records.any? |