-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
None
I have User, Post, and Replies. When I create new Post the User gets updated and can be access from user.posts_count. But for replies, it doesn't see user.replies_count or post.replies_count. I must add Post.update_counters(post.id, replies_count: post.replies.count) then post.reload
class User has_many :posts has_many :replies end class Post belongs_to :user, counter_cache: true has_many :replies end class Reply belongs_to :user, counter_cache: true belongs_to :post, counter_cache: true end
Is there something I'm missing?