uses cache counter for debate's comments

This commit is contained in:
Juanjo Bazán
2015-08-26 17:17:53 +02:00
parent 5d112ac2bf
commit dacbe27fda
5 changed files with 18 additions and 5 deletions

View File

@@ -9,7 +9,7 @@
<h3><%= link_to debate.title, debate %></h3>
<p class="debate-info">
<i class="icon-comments"></i>&nbsp;
<%= link_to t("debates.debate.comments", count: debate.comment_threads.count), debate_path(debate, anchor: "comments") %>
<%= link_to t("debates.debate.comments", count: debate.comments_count), debate_path(debate, anchor: "comments") %>
</p>
<div class="debate-description">
<%= link_to debate.description, debate %>

View File

@@ -40,7 +40,7 @@
<%= l @debate.created_at.to_date %>
<span class="bullet">&nbsp;&bullet;&nbsp;</span>
<i class="icon-comments"></i>&nbsp;
<%= link_to t("debates.show.comments", count: @debate.comment_threads.count), "#comments" %>
<%= link_to t("debates.show.comments", count: @debate.comments_count), "#comments" %>
<span class="bullet">&nbsp;&bullet;&nbsp;</span>
<span class="js-flag-as-inappropiate-actions">
<%= render 'debates/flag_as_inappropiate_actions', debate: @debate %>
@@ -79,7 +79,7 @@
<h2>
<%= t("debates.show.comments_title") %>
<span>(<%= @debate.comment_threads.count %>)</span>
<span>(<%= @debate.comments_count %>)</span>
</h2>
<% if user_signed_in? %>
<%= render 'comments/form', {parent: @debate, toggeable: false} %>