Don't send changeset comment notifications to deleted users
authorTom Hughes <tom@compton.nu>
Fri, 30 Oct 2015 19:01:09 +0000 (19:01 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 30 Oct 2015 19:01:09 +0000 (19:01 +0000)
app/controllers/changeset_controller.rb
test/fixtures/changesets_subscribers.yml

index 5b55980e3e93f0ff41f070a339b5fc38036bd1cd..9ac82d092878d933e8a0e5221a037a12ec27dcf1 100644 (file)
@@ -327,7 +327,7 @@ class ChangesetController < ApplicationController
                                         :author => @user)
 
     # Notify current subscribers of the new comment
-    changeset.subscribers.each do |user|
+    changeset.subscribers.visible.each do |user|
       if @user != user
         Notifier.changeset_comment_notification(comment, user).deliver_now
       end
index d8bd5be968da3dfd670682b82fc7b3337f2bcce4..c75287832fabd2ac5be4350b74564472cec9d08c 100644 (file)
@@ -5,3 +5,11 @@ t1:
 t2:
   changeset_id: 8
   subscriber_id: 1
+
+t3:
+  changeset_id: 8
+  subscriber_id: 10
+
+t4:
+  changeset_id: 8
+  subscriber_id: 11