It does not make sense to differentiate unread notifications

This commit is contained in:
Jorge Manrubia
2025-08-26 18:15:08 +02:00
parent d99a835184
commit 47fb35948b
+2 -6
View File
@@ -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")