aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-09-04 13:39:28 -0700
committerJon Leighton <j@jonathanleighton.com>2011-09-04 13:39:28 -0700
commit6c4650606735b51d86f9d0fa7711dc87f33d98df (patch)
tree6dda8a6eb139f8c223067e543628cc7e9b0b6e87 /activerecord/lib/active_record
parente865d125431424562b5e252ed151f6bae8dd5e8f (diff)
parent9066e3402548d365dc7cf2abda8e7cd64370675c (diff)
downloadrails-6c4650606735b51d86f9d0fa7711dc87f33d98df.tar.gz
rails-6c4650606735b51d86f9d0fa7711dc87f33d98df.tar.bz2
rails-6c4650606735b51d86f9d0fa7711dc87f33d98df.zip
Merge pull request #2855 from arunagw/fix_find_in_batches_master
We need to recorder here. Need to drop the order from default scope.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/relation/batches.rb2
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?