From 637371e60afe8244d35f1de9540252adf9b9e9b6 Mon Sep 17 00:00:00 2001
From: riking <rikingcoding@gmail.com>
Date: Tue, 9 Sep 2014 20:13:36 -0700
Subject: [PATCH] Switch to count of all notifications

---
 .../discourse/templates/user/user.js.handlebars           | 2 +-
 app/serializers/user_serializer.rb                        | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/app/assets/javascripts/discourse/templates/user/user.js.handlebars b/app/assets/javascripts/discourse/templates/user/user.js.handlebars
index 461b76a66..8435fbce0 100644
--- a/app/assets/javascripts/discourse/templates/user/user.js.handlebars
+++ b/app/assets/javascripts/discourse/templates/user/user.js.handlebars
@@ -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}}
diff --git a/app/serializers/user_serializer.rb b/app/serializers/user_serializer.rb
index 327c79526..8f916c9e9 100644
--- a/app/serializers/user_serializer.rb
+++ b/app/serializers/user_serializer.rb
@@ -43,7 +43,7 @@ class UserSerializer < BasicUserSerializer
              :suspended_till,
              :uploaded_avatar_id,
              :badge_count,
-             :unread_notification_count,
+             :notification_count,
              :has_title_badges,
              :edit_history_public,
              :custom_fields
@@ -77,7 +77,7 @@ class UserSerializer < BasicUserSerializer
                      :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,
@@ -244,8 +244,8 @@ class UserSerializer < BasicUserSerializer
     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?