From 9564a6ce0963a19f141c2ba05977db39784560be Mon Sep 17 00:00:00 2001 From: Robin Ward <robin.ward@gmail.com> Date: Thu, 8 Aug 2013 10:32:51 -0400 Subject: [PATCH] Don't include `user_deleted` posts in emails. --- app/mailers/user_notifications.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/mailers/user_notifications.rb b/app/mailers/user_notifications.rb index e22aa32da79..177f9ade8d9 100644 --- a/app/mailers/user_notifications.rb +++ b/app/mailers/user_notifications.rb @@ -110,6 +110,7 @@ class UserNotifications < ActionMailer::Base context = "" context_posts = Post.where(topic_id: @post.topic_id) .where("post_number < ?", @post.post_number) + .where(user_deleted: false) .order('created_at desc') .limit(SiteSetting.email_posts_context)