diff options
author | Damien Mathieu <42@dmathieu.com> | 2011-09-05 19:37:53 +0200 |
---|---|---|
committer | Damien Mathieu <42@dmathieu.com> | 2011-09-06 00:30:40 +0200 |
commit | 51da1e5c65d65208f8be9c4e6de7e9eed4b621c6 (patch) | |
tree | c32cbf36ab32b6902e3384aad81c15f285d50c03 /activerecord | |
parent | e221108c141fa564b7da6378478b762b356e0084 (diff) | |
download | rails-51da1e5c65d65208f8be9c4e6de7e9eed4b621c6.tar.gz rails-51da1e5c65d65208f8be9c4e6de7e9eed4b621c6.tar.bz2 rails-51da1e5c65d65208f8be9c4e6de7e9eed4b621c6.zip |
first and last orders the records by id
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/named_scope_test.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/test/cases/named_scope_test.rb b/activerecord/test/cases/named_scope_test.rb index ed0240cada..17ff765543 100644 --- a/activerecord/test/cases/named_scope_test.rb +++ b/activerecord/test/cases/named_scope_test.rb @@ -181,8 +181,8 @@ class NamedScopeTest < ActiveRecord::TestCase end def test_first_and_last_should_allow_integers_for_limit - assert_equal Topic.base.first(2), Topic.base.to_a.first(2) - assert_equal Topic.base.last(2), Topic.base.to_a.last(2) + assert_equal Topic.base.first(2), Topic.base.order("id").to_a.first(2) + assert_equal Topic.base.last(2), Topic.base.order("id").to_a.last(2) end def test_first_and_last_should_not_use_query_when_results_are_loaded |