From 5459e46e0d676655957e7474d33d7c9bff0d0f3b Mon Sep 17 00:00:00 2001 From: Holger Just Date: Fri, 8 Jul 2016 16:00:43 +0200 Subject: [PATCH] Reload watcher_users before sending issue notifications to gather all current watchers --- app/models/issue.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/models/issue.rb b/app/models/issue.rb index 5b6ae30..4734aed 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -1681,6 +1681,11 @@ class Issue < ActiveRecord::Base def send_notification if notify? && Setting.notified_events.include?('issue_added') + # Explicitly reload the has_many through relation watcher_users to help + # it notice new watchers we might have added since the issue was first + # created. + watcher_users.reload + Mailer.deliver_issue_add(self) end end -- 2.9.0