It does not make sense to differentiate unread notifications
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user