]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/changeset_controller.rb
Don't send changeset comment notifications to deleted users
[rails.git] / app / controllers / changeset_controller.rb
index 2ce024c76476d4332550f7e99fed2c8b7a83c261..9ac82d092878d933e8a0e5221a037a12ec27dcf1 100644 (file)
@@ -294,7 +294,7 @@ class ChangesetController < ApplicationController
         changesets = changesets.where("changesets.id <= ?", params[:max_id])
       end
 
-      @edits = changesets.order("changesets.id DESC").limit(20).preload(:user, :changeset_tags)
+      @edits = changesets.order("changesets.id DESC").limit(20).preload(:user, :changeset_tags, :comments)
 
       render :action => :list, :layout => false
     end
@@ -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