Merge pull request #1679 from basecamp/notifications

Cap the max number of unread notifications to 500
This commit is contained in:
Jason Zimdars
2025-11-21 09:34:26 -06:00
committed by GitHub
4 changed files with 37 additions and 25 deletions
+3 -1
View File
@@ -1,6 +1,8 @@
class NotificationsController < ApplicationController
MAX_UNREAD_NOTIFICATIONS = 500
def index
@unread = Current.user.notifications.unread.ordered.preloaded unless current_page_param
@unread = Current.user.notifications.unread.ordered.preloaded.limit(MAX_UNREAD_NOTIFICATIONS) unless current_page_param
set_page_and_extract_portion_from Current.user.notifications.read.ordered.preloaded
respond_to do |format|