aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2012-09-21 19:42:14 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2012-09-21 19:42:16 -0300
commit5b99cf088c89eba655adc588af40b1970fdd76a9 (patch)
tree9599b79fd919ff1a9368c3d4cf27650c993ef3cc /activerecord/test/cases
parenteb876c4d07130f15be2cac7be968cc393f959c62 (diff)
downloadrails-5b99cf088c89eba655adc588af40b1970fdd76a9.tar.gz
rails-5b99cf088c89eba655adc588af40b1970fdd76a9.tar.bz2
rails-5b99cf088c89eba655adc588af40b1970fdd76a9.zip
start could be a string
Related to 761bc751d31c22e2c2fdae2b4cdd435b68b6d783 and eb876c4d07130f15be2cac7be968cc393f959c62
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/batches_test.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/test/cases/batches_test.rb b/activerecord/test/cases/batches_test.rb
index 78d89aa232..4016f5f309 100644
--- a/activerecord/test/cases/batches_test.rb
+++ b/activerecord/test/cases/batches_test.rb
@@ -128,14 +128,14 @@ class EachTest < ActiveRecord::TestCase
old_primary_key = Post.primary_key
Post.primary_key = :title
title_order_posts = Post.order('title asc')
- start_title = title_order_posts.first.title
+ start_title = title_order_posts.second.title
posts = []
Post.find_in_batches(:batch_size => 1, :start => start_title) do |batch|
posts.concat(batch)
end
- assert_equal title_order_posts.map(&:id), posts.map(&:id)
+ assert_equal title_order_posts[1..-1].map(&:id), posts.map(&:id)
ensure
Post.primary_key = old_primary_key
end