diff options
author | Rick Olson <technoweenie@gmail.com> | 2006-07-31 21:06:19 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2006-07-31 21:06:19 +0000 |
commit | ab0277f22005b9690393318ef9adf94d815c1611 (patch) | |
tree | 3ba0194cfc0cae3eb23b126d3bb911a7aa3815b6 /activerecord/test | |
parent | d2eafa8b736c2f300658925e70290fb3d996959b (diff) | |
download | rails-ab0277f22005b9690393318ef9adf94d815c1611.tar.gz rails-ab0277f22005b9690393318ef9adf94d815c1611.tar.bz2 rails-ab0277f22005b9690393318ef9adf94d815c1611.zip |
Calculate sum with SQL, not Enumerable on HasManyThrough Associations. [Dan Peterson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4640 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/associations_join_model_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/associations_join_model_test.rb b/activerecord/test/associations_join_model_test.rb index ede21785e7..b5d48db8bc 100644 --- a/activerecord/test/associations_join_model_test.rb +++ b/activerecord/test/associations_join_model_test.rb @@ -370,6 +370,10 @@ class AssociationsJoinModelTest < Test::Unit::TestCase assert_raise(ActiveRecord::ReadOnlyAssociation) { posts(:thinking).tags.build(:name => 'foo') } assert_raise(ActiveRecord::ReadOnlyAssociation) { posts(:thinking).tags.create(:name => 'foo') } end + + def test_has_many_through_sum_uses_calculations + assert_nothing_raised { authors(:david).comments.sum(:post_id) } + end private # create dynamic Post models to allow different dependency options |