shows visible children of hidden comments

Fixes #368
This commit is contained in:
Juanjo Bazán
2015-09-06 12:46:14 +02:00
parent e3449723b3
commit 3845e6bfd2

View File

@@ -19,7 +19,7 @@ class DebatesController < ApplicationController
set_debate_votes(@debate) set_debate_votes(@debate)
@commentable = @debate @commentable = @debate
@root_comments = @debate.comments.roots.recent.page(params[:page]).per(10).for_render @root_comments = @debate.comments.roots.recent.page(params[:page]).per(10).for_render
@comments = @root_comments.inject([]){|all, root| all + root.descendants} @comments = @root_comments.inject([]){|all, root| all + Comment.descendants_of(root).for_render}
@all_visible_comments = @root_comments + @comments @all_visible_comments = @root_comments + @comments
set_comment_flags(@all_visible_comments) set_comment_flags(@all_visible_comments)