Use better method for querying moderation reports on posts and topics
- Also moved the control logic out of the views and into the models
This commit is contained in:
@@ -812,4 +812,8 @@ class User < ApplicationRecord
|
||||
def presenter
|
||||
@presenter ||= UserPresenter.new(self)
|
||||
end
|
||||
|
||||
def viewable_moderation_reports
|
||||
!is_moderator? && CurrentUser.is_moderator? ? moderation_reports : []
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user