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. --- guides/source/4_2_release_notes.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'guides/source/4_2_release_notes.md') diff --git a/guides/source/4_2_release_notes.md b/guides/source/4_2_release_notes.md index 6a847c3087..dd484ccee2 100644 --- a/guides/source/4_2_release_notes.md +++ b/guides/source/4_2_release_notes.md @@ -201,6 +201,12 @@ for detailed changes. ([Commit](https://github.com/rails/rails/commit/91949e48cf41af9f3e4ffba3e5eecf9b0a08bfc3)) +* Deprecated broken support for automatic detection of counter caches on + `has_many :through` associations. You should instead manually specify the + counter cache on the `has_many` and `belongs_to` associations for the through + records. + ([Pull Request](https://github.com/rails/rails/pull/15754)) + ### Notable changes * Added support for `#pretty_print` in `ActiveRecord::Base` objects. -- cgit v1.2.3