diff options
author | Eugene Kenny <elkenny@gmail.com> | 2018-01-14 20:46:19 +0000 |
---|---|---|
committer | Eugene Kenny <elkenny@gmail.com> | 2018-01-14 20:46:19 +0000 |
commit | 3e71bc4b048bef2ae7723dde5082020fd984bbd6 (patch) | |
tree | 988395bcd199720560661a316b8c2ee99b44c984 /activerecord/test/cases/connection_adapters | |
parent | fd04c8cbb6627ef65ea728b5026b21bd24471c18 (diff) | |
download | rails-3e71bc4b048bef2ae7723dde5082020fd984bbd6.tar.gz rails-3e71bc4b048bef2ae7723dde5082020fd984bbd6.tar.bz2 rails-3e71bc4b048bef2ae7723dde5082020fd984bbd6.zip |
Don't update counter cache when through record was not destroyed
When removing a record from a has many through association, the counter
cache was being updated even if the through record halted the callback
chain and prevented itself from being destroyed.
Diffstat (limited to 'activerecord/test/cases/connection_adapters')
-rw-r--r-- | activerecord/test/cases/connection_adapters/schema_cache_test.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/test/cases/connection_adapters/schema_cache_test.rb b/activerecord/test/cases/connection_adapters/schema_cache_test.rb index 006be9e65d..67496381d1 100644 --- a/activerecord/test/cases/connection_adapters/schema_cache_test.rb +++ b/activerecord/test/cases/connection_adapters/schema_cache_test.rb @@ -22,8 +22,8 @@ module ActiveRecord new_cache = YAML.load(YAML.dump(@cache)) assert_no_queries do - assert_equal 11, new_cache.columns("posts").size - assert_equal 11, new_cache.columns_hash("posts").size + assert_equal 12, new_cache.columns("posts").size + assert_equal 12, new_cache.columns_hash("posts").size assert new_cache.data_sources("posts") assert_equal "id", new_cache.primary_keys("posts") end @@ -75,8 +75,8 @@ module ActiveRecord @cache = Marshal.load(Marshal.dump(@cache)) assert_no_queries do - assert_equal 11, @cache.columns("posts").size - assert_equal 11, @cache.columns_hash("posts").size + assert_equal 12, @cache.columns("posts").size + assert_equal 12, @cache.columns_hash("posts").size assert @cache.data_sources("posts") assert_equal "id", @cache.primary_keys("posts") end |