Forum: Ruby on Rails counter cache column not updated by fixtures load

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A61a5cac149af9d66ddbbc23d6f152da?d=identicon&s=25 Cathal O'Riordan (coriordan)
on 2009-05-25 10:26
(Received via mailing list)
Hi,

I've added a counter cache column to a model. When I load my models
through fixtures, it doesn't seem to affect the counter.

regards,
C.
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-05-25 11:27
(Received via mailing list)
On May 25, 9:25 am, coriordan <corior...@tssg.org> wrote:
> Hi,
>
> I've added a counter cache column to a model. When I load my models
> through fixtures, it doesn't seem to affect the counter.
>
That's not handled magically for you (mainly because the counter cache
only gets updated via callbacks whereas fixtures are just plopped
straight in the database).

Fred
This topic is locked and can not be replied to.