This project is archived and is in readonly mode.

#1683 new
Adam

Custom counter caches not being used

Reported by Adam | January 2nd, 2009 @ 12:18 AM | in 3.x

If a belongs to uses a custom counter cache that is not of the form #{attribute_name}_count of the corresponding has_many association then they are not used.

A simple solution is to add a :counter_cache option to the has_many association.

The attached patch is complete with docs and tests.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Pages