Skip to content

Commit

Permalink
eliminate n+1 query in questions comments parent method (#8272)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tlazypanda authored Aug 11, 2020
1 parent 4452195 commit f38bd54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/questions/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<% comments = @node.comments_viewable_by(current_user) %>
<h3><span id="comment-count"><%= comments.length %></span> Comments</h3>
<div id="comments-list">
<% comments.includes(:replied_comments).order("timestamp ASC").each do |comment| %>
<% comments.includes([:node, :replied_comments]).order("timestamp ASC").each do |comment| %>
<% if comment.reply_to.nil? %>
<%= render :partial => "notes/comment", :locals => {:comment => comment} %>
<% end %>
Expand Down

0 comments on commit f38bd54

Please sign in to comment.