From 2558be85126b3d7db1cbdb22bbc4607907f1aaac Mon Sep 17 00:00:00 2001 From: albert Date: Tue, 5 Feb 2013 17:15:59 -0500 Subject: [PATCH] include creator when loading comments --- app/controllers/comments_controller.rb | 2 +- app/views/posts/show.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 2b7f56cdf..e9fd423b9 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -58,7 +58,7 @@ class CommentsController < ApplicationController private def index_for_post @post = Post.find(params[:post_id]) - @comments = @post.comments + @comments = @post.comments.includes(:creator) @comments = @comments.visible(CurrentUser.user) unless params[:include_below_threshold] render :action => "index_for_post" end diff --git a/app/views/posts/show.html.erb b/app/views/posts/show.html.erb index 75cf09b3b..6aae9f88b 100644 --- a/app/views/posts/show.html.erb +++ b/app/views/posts/show.html.erb @@ -53,7 +53,7 @@
- <%= render "comments/partials/index/list", :comments => @post.comments, :post => @post, :show_header => false %> + <%= render "comments/partials/index/list", :comments => @post.comments.includes(:creator), :post => @post, :show_header => false %>