fix: Send assignment notifications only to the assignee(s)

ref: https://37s.fizzy.37signals.com/buckets/693169850/bubbles/999008619
This commit is contained in:
Mike Dalessio
2025-03-13 12:14:17 -04:00
parent eabcc1d477
commit 3e374f4661
2 changed files with 10 additions and 0 deletions
+4
View File
@@ -1,2 +1,6 @@
class Notifier::Assigned < Notifier
private
def recipients
event.assignees
end
end
+6
View File
@@ -33,4 +33,10 @@ class NotifierTest < ActiveSupport::TestCase
assert_equal bubbles(:logo), Notification.last.resource
end
test "for assignment events only create a notification for the assignee" do
notifications = Notifier.for(events(:logo_assignment_jz)).generate
assert_equal [ users(:jz) ], notifications.map(&:user)
end
end