Sign in through GitHub

RailsCasts Pro episodes are now free!

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.