Fixes #1230. Makes comment counter more efficient

This commit is contained in:
Emanuel Hayford 2017-03-16 06:41:15 +01:00
parent c5e3d495bb
commit 33df0ee8e4
5 changed files with 21 additions and 3 deletions

View file

@ -8,7 +8,7 @@ class Comment < ActiveRecord::Base
# want user to vote on the quality of comments.
#acts_as_votable
belongs_to :commentable, polymorphic: true
belongs_to :commentable, polymorphic: true, counter_cache: true
# NOTE: Comments belong to a user
belongs_to :user