include creator when loading comments

This commit is contained in:
albert
2013-02-05 17:15:59 -05:00
parent 1506fe88cd
commit 2558be8512
2 changed files with 2 additions and 2 deletions

View File

@@ -58,7 +58,7 @@ class CommentsController < ApplicationController
private private
def index_for_post def index_for_post
@post = Post.find(params[:post_id]) @post = Post.find(params[:post_id])
@comments = @post.comments @comments = @post.comments.includes(:creator)
@comments = @comments.visible(CurrentUser.user) unless params[:include_below_threshold] @comments = @comments.visible(CurrentUser.user) unless params[:include_below_threshold]
render :action => "index_for_post" render :action => "index_for_post"
end end

View File

@@ -53,7 +53,7 @@
</menu> </menu>
<section id="comments"> <section id="comments">
<%= 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 %>
</section> </section>
<section id="notes" style="display: none;"> <section id="notes" style="display: none;">