Counter_cache not updating


I’m using those 2 models:

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

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

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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs