mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
PERF: disable PM stats when explicitly omitting stats
This commit is contained in:
parent
130dbf7358
commit
e9c5e17fbe
1 changed files with 4 additions and 0 deletions
|
@ -252,6 +252,10 @@ class UserSerializer < BasicUserSerializer
|
|||
CategoryUser.lookup(object, :watching).pluck(:category_id)
|
||||
end
|
||||
|
||||
def include_private_message_stats?
|
||||
can_edit && !(omit_stats == true)
|
||||
end
|
||||
|
||||
def private_messages_stats
|
||||
UserAction.private_messages_stats(object.id, scope)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue