Forum: Ruby on Rails counter_cache not updating

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.
E6dcb4743b83392a4fc39693f110cc26?d=identicon&s=25 =?UTF-8?Q?J=C3=A9r=C3=B4me_L?= (Guest)
on 2005-12-15 00:21
(Received via mailing list)
Hi

I'm using those 2 models:

class Topic < ActiveRecord::Base
   has_many :articles, :order => :rank
end

class Article < ActiveRecord::Base
   belongs_to :topic, :counter_cache => true
end


The "counter_cache" column in the "topics" table does increase when
adding a new article, but it does not update when updating article's
topic or when deleting the article.

Any idea ?
This topic is locked and can not be replied to.