This commit is contained in:
Emanuel 2017-03-17 01:39:59 +00:00 committed by GitHub
commit 6fac651188
7 changed files with 30 additions and 12 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

View file

@ -183,4 +183,4 @@
%ul.dropdown-menu{role: 'menu'}
= render 'change_state_dropdown', event: event
%td.text-center
= link_to "#{event.comment_threads.count}", admin_conference_program_event_path(@conference.short_title, event), anchor: 'comments-div'
= link_to "#{event.comments_count}", admin_conference_program_event_path(@conference.short_title, event), anchor: 'comments-div'