diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index 1bde525567d..cb515169f68 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -3,7 +3,7 @@ class NotificationsController < ApplicationController before_filter :ensure_logged_in def index - notifications = Notification.recent_report(current_user) + notifications = Notification.recent_report(current_user, 10) current_user.saw_notification_id(notifications.first.id) if notifications.present? current_user.reload diff --git a/app/models/notification.rb b/app/models/notification.rb index 0e11ba078f6..c4b489ffd8e 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -90,7 +90,7 @@ class Notification < ActiveRecord::Base end def self.recent_report(user, count = nil) - + count ||= 10 notifications = user.notifications.recent(count).includes(:topic).to_a if notifications.present?