From 710e3710813e52ce71ee2cd5a754cf6462b2ecd3 Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Sun, 4 Nov 2012 17:09:25 +0100 Subject: :counter_cache option for to support custom named counter caches. Closes #7993 --- .../test/cases/associations/has_many_associations_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'activerecord/test/cases') 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") -- cgit v1.2.3