PERF: disable PM stats when explicitly omitting stats
This commit is contained in:
parent
130dbf7358
commit
e9c5e17fbe
|
@ -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 New Issue