PERF: remove uneeded data, notification count is pointless

Getting notification count is expensive, no point shipping it to clients
This commit is contained in:
Sam 2015-09-10 16:44:42 +10:00
parent f6bc46937b
commit 0b9322d16a
2 changed files with 0 additions and 7 deletions

View File

@ -170,7 +170,6 @@
{{#link-to 'user.notifications'}}
{{fa-icon "comment" class="glyph"}}
{{i18n 'user.notifications'}}
<span class='count'>({{model.notification_count}})</span>
{{/link-to}}
{{/link-to}}
{{/if}}

View File

@ -60,7 +60,6 @@ class UserSerializer < BasicUserSerializer
:suspended_till,
:uploaded_avatar_id,
:badge_count,
:notification_count,
:has_title_badges,
:edit_history_public,
:custom_fields,
@ -93,7 +92,6 @@ class UserSerializer < BasicUserSerializer
:tracked_category_ids,
:watched_category_ids,
:private_messages_stats,
:notification_count,
:disable_jump_reply,
:gravatar_avatar_upload_id,
:custom_avatar_upload_id,
@ -292,10 +290,6 @@ class UserSerializer < BasicUserSerializer
object.badges.where(allow_title: true).count > 0
end
def notification_count
Notification.where(user_id: object.id).count
end
def include_edit_history_public?
can_edit && !SiteSetting.edit_history_visible_to_public
end