diff --git a/app/models/comment.rb b/app/models/comment.rb index d4ceb9e3e..913dd0780 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -1,5 +1,5 @@ class Comment < ActiveRecord::Base - acts_as_nested_set scope: [:commentable_id, :commentable_type] + acts_as_nested_set scope: [:commentable_id, :commentable_type], counter_cache: :children_count acts_as_votable validates :body, presence: true diff --git a/app/views/comments/_comment.html.erb b/app/views/comments/_comment.html.erb index 4e375c540..9707c6462 100644 --- a/app/views/comments/_comment.html.erb +++ b/app/views/comments/_comment.html.erb @@ -14,11 +14,12 @@
- númerototal respuestas - <% if user_signed_in? %> - | - <%= render 'comments/form', {parent: comment, toggeable: true} %>
- <% end %> + <%= t("debates.debate.responses", count: comment.children_count) %> + <% if user_signed_in? %> + | + <%= render 'comments/form', {parent: comment, toggeable: true} %> + <% end %> +
<%= link_to debate.title, debate %>
- <%= link_to pluralize(debate.comment_threads.count, t("debates.debate.comment"), t("debates.debate.comments")), debate_path(debate, anchor: "comments") %> + <%= link_to t("debates.debate.comments", count: debate.comment_threads.count), debate_path(debate, anchor: "comments") %>
<%= t("debates.show.comments") %>
+<%= t("debates.show.comments_title") %>
<% if user_signed_in? %><%= link_to featured_debate.title, featured_debate %>
- <%= link_to pluralize(featured_debate.comment_threads.count, t("debates.show.comment"), t("debates.show.comments")), debate_path(featured_debate, anchor: "comments") %> + <%= link_to t("debates.show.comments", count: featured_debate.comment_threads.count), debate_path(featured_debate, anchor: "comments") %>