From 47fb35948b992b8b4ef662f9fea24f768d9bfb6b Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Tue, 26 Aug 2025 18:15:08 +0200 Subject: [PATCH] It does not make sense to differentiate unread notifications --- app/models/notification/bundle.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/models/notification/bundle.rb b/app/models/notification/bundle.rb index 2a5e9ed79..98c2d131b 100644 --- a/app/models/notification/bundle.rb +++ b/app/models/notification/bundle.rb @@ -31,13 +31,13 @@ class Notification::Bundle < ApplicationRecord end def notifications - user.notifications.where(created_at: window) + user.notifications.where(created_at: window).unread end def deliver processing! - BundleMailer.notification(self).deliver if has_unread_notifications? + BundleMailer.notification(self).deliver if notifications.any? delivered! end @@ -58,10 +58,6 @@ class Notification::Bundle < ApplicationRecord starts_at..ends_at end - def has_unread_notifications? - notifications.unread.any? - end - def validate_no_overlapping if overlapping_bundles.exists? errors.add(:base, "Bundle window overlaps with an existing pending bundle")