PERF: fix N+1 queries for non-JS topic view.

This commit is contained in:
Vinoth Kannan 2019-06-03 21:47:33 +05:30
parent d4f6b9e827
commit f9f12ed221
1 changed files with 2 additions and 1 deletions

View File

@ -46,7 +46,8 @@
<a itemprop="url" href='<%= Discourse.base_uri %>/u/<%= u.username %>'><span itemprop='name'><%= u.username %></span></a>
<%= "(#{u.name})" if (SiteSetting.display_name_on_posts && SiteSetting.enable_names? && !u.name.blank?) %>
<%
who_username = post.custom_fields["action_code_who"] || ""
post_custom_fields = @topic_view.post_custom_fields[post.id] || {}
who_username = post_custom_fields["action_code_who"] || ""
if post.action_code
%>
<%= t("js.action_codes.#{post.action_code}", when: "", who: who_username).html_safe %>