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