From 39c0a95e1a122db16f4247af9d3b7b521d5e078a Mon Sep 17 00:00:00 2001 From: Kevin McConnell Date: Fri, 7 Feb 2025 16:24:18 +0000 Subject: [PATCH] We'll handle this at the event level --- app/models/notifier.rb | 10 ++-------- test/models/notifier_test.rb | 8 -------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/app/models/notifier.rb b/app/models/notifier.rb index 86c07b54d..cb64ec77c 100644 --- a/app/models/notifier.rb +++ b/app/models/notifier.rb @@ -10,10 +10,8 @@ class Notifier end def generate - if should_notify? - recipients.map do |recipient| - Notification.create! user: recipient, event: event, bubble: bubble, resource: resource - end + recipients.map do |recipient| + Notification.create! user: recipient, event: event, bubble: bubble, resource: resource end end @@ -22,10 +20,6 @@ class Notifier @event = event end - def should_notify? - bubble.published? - end - def recipients bubble.bucket.users.without(creator) end diff --git a/test/models/notifier_test.rb b/test/models/notifier_test.rb index 36cbfca5d..37afd1b6c 100644 --- a/test/models/notifier_test.rb +++ b/test/models/notifier_test.rb @@ -18,12 +18,4 @@ class NotifierTest < ActiveSupport::TestCase Notifier.for(events(:logo_published)).generate end end - - test "generate does not create notifications if the bubble is not published" do - bubbles(:logo).drafted! - - assert_no_difference -> { Notification.count } do - Notifier.for(events(:logo_published)).generate - end - end end