diff options
author | Neeraj Singh and Santiago Pastorino <neeraj+santiago@wyeworks.com> | 2010-06-24 22:52:15 -0300 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2010-06-25 15:57:04 -0300 |
commit | 0ebb5bf6590b8ac62c53538ade7095676baec3d4 (patch) | |
tree | d5cb0d2659f27faa00cdf9dc54c7247e042b954d /activerecord/test/cases/relations_test.rb | |
parent | 3d8ccb924084ecd341b2d9644e6e0b66903d8432 (diff) | |
download | rails-0ebb5bf6590b8ac62c53538ade7095676baec3d4.tar.gz rails-0ebb5bf6590b8ac62c53538ade7095676baec3d4.tar.bz2 rails-0ebb5bf6590b8ac62c53538ade7095676baec3d4.zip |
Support for multiple selects added
[#4841 state:committed]
Diffstat (limited to 'activerecord/test/cases/relations_test.rb')
-rw-r--r-- | activerecord/test/cases/relations_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index abf43cea98..5b1c6b8f22 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -491,6 +491,12 @@ class RelationTest < ActiveRecord::TestCase assert_equal 0, posts.count('comments_count') end + def test_multiple_selects + post = Post.scoped.select('comments_count').select('title').order("id ASC").first + assert_equal "Welcome to the weblog", post.title + assert_equal 2, post.comments_count + end + def test_size posts = Post.scoped |