From d730e374ca99a60b08c75aab7b0ed8a846a34924 Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Sun, 15 Jun 2014 09:19:54 -0600 Subject: Deprecate automatic counter caches on has_many :through Reliant on https://github.com/rails/rails/pull/15747 but pulled to a separate PR to reduce noise. `has_many :through` associations have the undocumented behavior of automatically detecting counter caches. However, the way in which it does so is inconsistent with counter caches everywhere else, and doesn't actually work consistently. As with normal `has_many` associations, the user should specify the counter cache on the `belongs_to`, if they'd like it updated. --- activerecord/test/schema/schema.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'activerecord/test/schema') diff --git a/activerecord/test/schema/schema.rb b/activerecord/test/schema/schema.rb index fd85050dd4..6ce82c71a8 100644 --- a/activerecord/test/schema/schema.rb +++ b/activerecord/test/schema/schema.rb @@ -190,7 +190,7 @@ ActiveRecord::Schema.define do t.text :body, null: false end t.string :type - t.integer :taggings_count, default: 0 + t.integer :tags_count, default: 0 t.integer :children_count, default: 0 t.integer :parent_id t.references :author, polymorphic: true @@ -569,7 +569,6 @@ ActiveRecord::Schema.define do end t.string :type t.integer :comments_count, default: 0 - t.integer :taggings_count, default: 0 t.integer :taggings_with_delete_all_count, default: 0 t.integer :taggings_with_destroy_count, default: 0 t.integer :tags_count, default: 0 -- cgit v1.2.3