diff options
author | Ben Woosley <ben.woosley@gmail.com> | 2013-05-10 20:45:09 +0200 |
---|---|---|
committer | Ben Woosley <ben.woosley@gmail.com> | 2013-05-10 20:45:09 +0200 |
commit | a2e607e1055dcede27970ccd7f5b89a1ddee8c32 (patch) | |
tree | 595e27bae9bb51850f61e8be53f083fd82cce52b /activerecord/test | |
parent | 86cc141ed5fd51ec752c956febfa436d1c816532 (diff) | |
download | rails-a2e607e1055dcede27970ccd7f5b89a1ddee8c32.tar.gz rails-a2e607e1055dcede27970ccd7f5b89a1ddee8c32.tar.bz2 rails-a2e607e1055dcede27970ccd7f5b89a1ddee8c32.zip |
Make NullRelation a bit more like a real relation by returning 0 for #calculate(:count)
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/relations_test.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index cf6af4e8f4..2ab5231458 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -278,8 +278,9 @@ class RelationTest < ActiveRecord::TestCase def test_null_relation_calculations_methods assert_no_queries do - assert_equal 0, Developer.none.count - assert_equal nil, Developer.none.calculate(:average, 'salary') + assert_equal 0, Developer.none.count + assert_equal 0, Developer.none.calculate(:count, nil, {}) + assert_equal nil, Developer.none.calculate(:average, 'salary') end end |