From dfc1ccb108da882646fe82109d5bf26b487adb94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?= Date: Thu, 3 Sep 2015 17:13:19 +0200 Subject: [PATCH] renames helper method --- app/helpers/comments_helper.rb | 2 +- app/views/comments/_comment.html.erb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/helpers/comments_helper.rb b/app/helpers/comments_helper.rb index 314518e0b..36952af7d 100644 --- a/app/helpers/comments_helper.rb +++ b/app/helpers/comments_helper.rb @@ -12,7 +12,7 @@ module CommentsHelper parent_id.blank? ? dom_id(commentable) : "comment_#{parent_id}" end - def children_of_in(parent, comments) + def select_children(comments, parent) return [] if comments.blank? comments.select{|c| c.parent_id == parent.id} end diff --git a/app/views/comments/_comment.html.erb b/app/views/comments/_comment.html.erb index 37a80d830..3ee61e9f4 100644 --- a/app/views/comments/_comment.html.erb +++ b/app/views/comments/_comment.html.erb @@ -2,7 +2,7 @@
<% if comment.hidden? || comment.user.hidden? %> - <% if children_of_in(comment, @comments).size > 0 %> + <% if select_children(@comments, comment).size > 0 %>

<%= t("debates.comment.deleted") %>

@@ -79,7 +79,7 @@
- <%= t("debates.comment.responses", count: children_of_in(comment, @comments).size) %> + <%= t("debates.comment.responses", count: select_children(@comments, comment).size) %> <% if user_signed_in? %>  |  @@ -95,7 +95,7 @@ <% end %>
- <%= render children_of_in(comment, @comments) if @comments.present? %> + <%= render select_children(@comments, comment) if @comments.present? %>