rails/rails — pull request #7706 by iangreenleaf (2012-09-19 21:51:30+00:00)
Title: Update other counter caches on destroy

When a model is destroyed by a `:dependent => :destroy` association, the counter cache is optimized not to update the destroyed parent's counter. However, the optimization is over-zealous and prevents updating of *any* counter cache from that model, which causes incorrect behavior on models with more than one `belongs_to` with counter caches.