diff options
author | Simon Woker <github@simonwoker.de> | 2014-04-10 16:58:39 +0000 |
---|---|---|
committer | Simon Woker <github@simonwoker.de> | 2014-04-10 16:58:39 +0000 |
commit | afd4d8205e6a3264c30a29e4a2de0f1e71ef0717 (patch) | |
tree | 930251fb12963067450fa672ed3990e253035694 /activerecord/test | |
parent | d8d0fcb06aae164b57695749ee394eee6996ee4d (diff) | |
download | rails-afd4d8205e6a3264c30a29e4a2de0f1e71ef0717.tar.gz rails-afd4d8205e6a3264c30a29e4a2de0f1e71ef0717.tar.bz2 rails-afd4d8205e6a3264c30a29e4a2de0f1e71ef0717.zip |
Fix error for aggregate methods with select, see issue #13648
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/relations_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index 2aa6d643a5..da932b7663 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -824,6 +824,16 @@ class RelationTest < ActiveRecord::TestCase assert_raises(ActiveRecord::ActiveRecordError) { Author.limit(10).delete_all } end + def test_select_with_aggregates + posts = Post.select(:title, :body) + + assert_equal 11, posts.count(:all) + assert_equal 11, posts.size + assert posts.any? + assert posts.many? + assert ! posts.empty? + end + def test_select_takes_a_variable_list_of_args david = developers(:david) |