diff options
author | Yves Senn <yves.senn@gmail.com> | 2012-11-04 17:09:25 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2012-11-04 17:09:25 +0100 |
commit | 710e3710813e52ce71ee2cd5a754cf6462b2ecd3 (patch) | |
tree | 4622f9356af6e19830920c2f875f122194655deb /activerecord/test/cases | |
parent | f786469f54332458ed60a1bbefec3125afe5f64b (diff) | |
download | rails-710e3710813e52ce71ee2cd5a754cf6462b2ecd3.tar.gz rails-710e3710813e52ce71ee2cd5a754cf6462b2ecd3.tar.bz2 rails-710e3710813e52ce71ee2cd5a754cf6462b2ecd3.zip |
:counter_cache option for to support custom named counter caches. Closes #7993
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/associations/has_many_associations_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb index 50c23c863f..8077222e30 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -754,6 +754,14 @@ class HasManyAssociationsTest < ActiveRecord::TestCase end end + def test_custom_named_counter_cache + topic = topics(:first) + + assert_difference "topic.reload.replies_count", -1 do + topic.approved_replies.clear + end + end + def test_deleting_a_collection force_signal37_to_load_all_clients_of_firm companies(:first_firm).clients_of_firm.create("name" => "Another Client") |