diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-12-29 04:28:43 +0530 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-12-29 04:30:04 +0530 |
commit | 08633bae5e4f05e913ec5d5d2483bfd6c07c7375 (patch) | |
tree | 9ceafedbf6825b2b756dabc34a4e297df4971741 /activerecord/test/cases/associations/inner_join_association_test.rb | |
parent | 949c8c0d0e92e6e7855dc4decc10eb4c658e0ede (diff) | |
download | rails-08633bae5e4f05e913ec5d5d2483bfd6c07c7375.tar.gz rails-08633bae5e4f05e913ec5d5d2483bfd6c07c7375.tar.bz2 rails-08633bae5e4f05e913ec5d5d2483bfd6c07c7375.zip |
Migrate all the calculation methods to Relation
Diffstat (limited to 'activerecord/test/cases/associations/inner_join_association_test.rb')
-rw-r--r-- | activerecord/test/cases/associations/inner_join_association_test.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/inner_join_association_test.rb b/activerecord/test/cases/associations/inner_join_association_test.rb index 18a1cd3cd0..0315604106 100644 --- a/activerecord/test/cases/associations/inner_join_association_test.rb +++ b/activerecord/test/cases/associations/inner_join_association_test.rb @@ -81,6 +81,8 @@ class InnerJoinAssociationTest < ActiveRecord::TestCase end def test_calculate_honors_implicit_inner_joins + Author.calculate(:count, 'authors.id', :joins => :posts) + return real_count = Author.scoped.to_a.sum{|a| a.posts.count } assert_equal real_count, Author.calculate(:count, 'authors.id', :joins => :posts), "plain inner join count should match the number of referenced posts records" end |