diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-12-27 15:06:45 +0530 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-12-27 15:06:45 +0530 |
commit | 81608cf8fa61973d65f24efbc4ae4931016888e7 (patch) | |
tree | b4ae5cb3ea565b606de32b6cfb77f0f91dd6436f /activerecord/test | |
parent | 1efc8edb5f8799c48ba1992e07a8566bb12b7224 (diff) | |
download | rails-81608cf8fa61973d65f24efbc4ae4931016888e7.tar.gz rails-81608cf8fa61973d65f24efbc4ae4931016888e7.tar.bz2 rails-81608cf8fa61973d65f24efbc4ae4931016888e7.zip |
Make Model.all return an array rather than a relation for consistency. Use Model.scoped to get a relation
Diffstat (limited to 'activerecord/test')
-rwxr-xr-x | activerecord/test/cases/base_test.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 4c16cb4804..b51c9f0cb3 100755 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -1902,8 +1902,14 @@ class BasicsTest < ActiveRecord::TestCase assert_equal Developer.find(:first, :order => 'id desc'), Developer.last end + def test_all + developers = Developer.all + assert_kind_of Array, developers + assert_equal Developer.find(:all), developers + end + def test_all_with_conditions - assert_equal Developer.find(:all, :order => 'id desc'), Developer.all.order('id desc').to_a + assert_equal Developer.find(:all, :order => 'id desc'), Developer.order('id desc').all end def test_find_ordered_last |