diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2010-01-19 22:52:08 +0530 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2010-01-19 22:52:08 +0530 |
commit | dbce07b81d24a991ddd29b91f9c358b1f236bda2 (patch) | |
tree | d2d3e5f5ebce075311fa1ab22e7749e7549879c7 /activerecord/test | |
parent | 9465b84b543ae1ada29c0e39e34f919c724eab6d (diff) | |
download | rails-dbce07b81d24a991ddd29b91f9c358b1f236bda2.tar.gz rails-dbce07b81d24a991ddd29b91f9c358b1f236bda2.tar.bz2 rails-dbce07b81d24a991ddd29b91f9c358b1f236bda2.zip |
Give preference to to_a over arel from Relation#method_missing
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/named_scope_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/named_scope_test.rb b/activerecord/test/cases/named_scope_test.rb index 3e2bd58f9a..2c34ab787d 100644 --- a/activerecord/test/cases/named_scope_test.rb +++ b/activerecord/test/cases/named_scope_test.rb @@ -379,6 +379,12 @@ class NamedScopeTest < ActiveRecord::TestCase def test_deprecated_named_scope_method assert_deprecated('named_scope has been deprecated') { Topic.named_scope :deprecated_named_scope } end + + def test_index_on_named_scope + approved = Topic.approved.order('id ASC') + assert_equal topics(:second), approved[0] + assert approved.loaded? + end end class DynamicScopeMatchTest < ActiveRecord::TestCase |