forum_topics/show: fix N+1 query patterns.

This commit is contained in:
evazion
2020-02-05 18:05:56 -06:00
parent db4c67ee86
commit 69f653b0c4
6 changed files with 6 additions and 22 deletions

View File

@@ -40,7 +40,7 @@
<% if forum_post.reportable_by?(CurrentUser.user) %>
<li><%= link_to "Report", new_moderation_report_path(moderation_report: { model_type: "ForumPost", model_id: forum_post.id }), remote: true, title: "Report this forum post to the moderators" %></li>
<% end %>
<% if forum_post.votable? %>
<% if forum_post.bulk_update_request.present? %>
<ul class="votes" id="forum-post-votes-for-<%= forum_post.id %>">
<%= render "forum_post_votes/list", votes: forum_post.votes, forum_post: forum_post %>
</ul>