Skip to content

Commit

Permalink
Switch to count of all notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
riking committed Sep 10, 2014
1 parent 5dfd3fc commit 637371e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
{{#link-to 'user.notifications'}}
<i class='glyph fa fa-comment'></i>
{{i18n user.notifications}}
<span class='count'>({{unread_notification_count}})</span>
<span class='count'>({{notification_count}})</span>
<span class='fa fa-chevron-right'></span>
{{/link-to}}
{{/link-to}}
Expand Down
8 changes: 4 additions & 4 deletions app/serializers/user_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def self.private_attributes(*attrs)
:suspended_till,
:uploaded_avatar_id,
:badge_count,
:unread_notification_count,
:notification_count,
:has_title_badges,
:edit_history_public,
:custom_fields
Expand Down Expand Up @@ -77,7 +77,7 @@ def self.private_attributes(*attrs)
:tracked_category_ids,
:watched_category_ids,
:private_messages_stats,
:unread_notification_count,
:notification_count,
:disable_jump_reply,
:gravatar_avatar_upload_id,
:custom_avatar_upload_id,
Expand Down Expand Up @@ -244,8 +244,8 @@ def has_title_badges
object.badges.where(allow_title: true).count > 0
end

def unread_notification_count
Notification.where(user_id: object.id, read: false).count
def notification_count
Notification.where(user_id: object.id).count
end

def include_edit_history_public?
Expand Down

0 comments on commit 637371e

Please sign in to comment.