Forum: Ruby on Rails counter_cache and updates

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
etlund (Guest)
on 2006-04-12 04:06
(Received via mailing list)
I'm trying to figure out how to use counter_cache.

I've got Clients that have many Profiles. And I got things working so
when I add a new Profile, the profiles_count gets updated.

profile =[:profile])

However, I'm stuck trying to figure out how to deal with UPDATING a
(moving it to a different Client).  If I change the profile to a new
I can get the right profiles_count on the NEW client, but the OLD client
not updated (to reflect one fewer profile)

Anyone have any suggestion?  I've been surprised at how little
I've found about using couter_cache.  Any good, thorough tutorials out


View this message in context:
Sent from the RubyOnRails Users forum at
This topic is locked and can not be replied to.