diff options
author | Jon Leighton <j@jonathanleighton.com> | 2012-11-09 05:42:04 -0800 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2012-11-09 05:42:04 -0800 |
commit | dbb39e53414294818c056f1db336471dd347d413 (patch) | |
tree | eaa22d1547eeb953a532e53dffe698780dfc42ab /activerecord/test/cases | |
parent | edd94cee9af1688dd036fc58fd405adb30a5e0da (diff) | |
parent | 710e3710813e52ce71ee2cd5a754cf6462b2ecd3 (diff) | |
download | rails-dbb39e53414294818c056f1db336471dd347d413.tar.gz rails-dbb39e53414294818c056f1db336471dd347d413.tar.bz2 rails-dbb39e53414294818c056f1db336471dd347d413.zip |
Merge pull request #8116 from senny/7993_configure_counter_cache_for_has_many
:counter_cache option for to support custom named counter caches
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 aae93bb9d0..45b0a76f5a 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") |