Skip to content

Commit 4ce8294

Browse files
committed
switched posts/_expanded to Flag#accessible_to
1 parent ad046ca commit 4ce8294

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

app/views/posts/_expanded.html.erb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,11 +326,7 @@
326326
<i class="fa fa-wrench"></i>
327327
Tools
328328
</a>
329-
<% flags_count = if current_user&.at_least_moderator?
330-
post.flags
331-
else
332-
post.flags.not_confidential
333-
end.where(handled_by_id: nil).count %>
329+
<% flags_count = Flag.accessible_to(current_user, post).where(handled_by_id: nil).count %>
334330

335331
<% own_flags_count = if current_user&.at_least_moderator?
336332
0

0 commit comments

Comments
 (0)