Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Sergey Alekseev's Profile

GitHub User: sergey-alekseev


Comments by Sergey Alekseev


Sorry, we can use .reset_counters: { |id| Category.reset_counters(id, :products) }


Specifying a counter cache will add it to that model’s list of readonly attributes using attr_readonly.

I think raw SQL within migration is the only option to update counter cache column.