moderation reports: pass CurrentUser to visible explicitly.

This is for consistency with how `visible` works in other models.
This commit is contained in:
evazion
2020-03-21 22:14:45 -05:00
parent 2445e8b82f
commit 94aff2c777
5 changed files with 8 additions and 8 deletions

View File

@@ -5,10 +5,10 @@
<div id="a-show">
<h1><%= link_to_user @user %></h1>
<% if @user.moderation_reports.visible.recent.present? %>
<% if @user.moderation_reports.visible(CurrentUser.user).recent.present? %>
<div class="moderation-users-notice">
<span class="info" id="moderation-users-notice-for-<%= @user.id %>">
This user has been reported for moderation! (<%= pluralize(@user.moderation_reports.visible.recent.length, "report") %>)
This user has been reported for moderation! (<%= pluralize(@user.moderation_reports.visible(CurrentUser.user).recent.length, "report") %>)
</span>
</div>
<% end %>