Implements comment sorting in proposals and debates
This commit is contained in:
@@ -16,7 +16,7 @@ module CommentableActions
|
||||
def show
|
||||
set_resource_votes(resource)
|
||||
@commentable = resource
|
||||
@root_comments = resource.comments.roots.recent.page(params[:page]).per(10).for_render
|
||||
@root_comments = resource.comments.roots.send("sort_by_#{@current_order}").page(params[:page]).per(10).for_render
|
||||
@comments = @root_comments.inject([]){|all, root| all + Comment.descendants_of(root).for_render}
|
||||
@all_visible_comments = @root_comments + @comments
|
||||
|
||||
@@ -91,4 +91,4 @@ module CommentableActions
|
||||
def index_customization
|
||||
nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user