aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/base_test.rb
diff options
context:
space:
mode:
authorJason Meller <jason.meller@mandiant.com>2014-01-18 00:51:34 -0500
committerJason Meller <jason.meller@mandiant.com>2014-01-20 16:58:18 -0500
commitcafe31a078276dbf941bd8b30f0caddc878c0830 (patch)
tree5c6b3f1d480c2d5aa2600dd144b932c950394a11 /activerecord/test/cases/base_test.rb
parent5a09f13a34426a02a305a12dfc90ced9bdd6c46e (diff)
downloadrails-cafe31a078276dbf941bd8b30f0caddc878c0830.tar.gz
rails-cafe31a078276dbf941bd8b30f0caddc878c0830.tar.bz2
rails-cafe31a078276dbf941bd8b30f0caddc878c0830.zip
Ensure #second acts like #first AR finder
This commit bring the famous ordinal Array instance methods defined in ActiveSupport into ActiveRecord as fully-fledged finders. These finders ensure a default ascending order of the table's primary key, and utilize the OFFSET SQL verb to locate the user's desired record. If an offset is defined in the query, calling #second adds to the offset to get the actual desired record. Fixes #13743.
Diffstat (limited to 'activerecord/test/cases/base_test.rb')
-rw-r--r--activerecord/test/cases/base_test.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb
index ef1ebbb400..8a0b0b9589 100644
--- a/activerecord/test/cases/base_test.rb
+++ b/activerecord/test/cases/base_test.rb
@@ -321,7 +321,7 @@ class BasicsTest < ActiveRecord::TestCase
def test_load
topics = Topic.all.merge!(:order => 'id').to_a
- assert_equal(4, topics.size)
+ assert_equal(5, topics.size)
assert_equal(topics(:first).title, topics.first.title)
end