From 67463af4f46ad5eb40bd77b3d659b977cd42a120 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Fri, 28 Feb 2014 11:14:36 -0500 Subject: [PATCH] BUGFIX: Don't include deleted topics in activity. Deleted posts are OK. --- app/models/user_action.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/user_action.rb b/app/models/user_action.rb index 0601f468d60..cf887edd2c2 100644 --- a/app/models/user_action.rb +++ b/app/models/user_action.rb @@ -263,8 +263,12 @@ SQL def self.apply_common_filters(builder,user_id,guardian,ignore_private_messages=false) + # We never return deleted topics in activity + builder.where("t.deleted_at is null") + + # We will return deleted posts though if the user can see it unless guardian.can_see_deleted_posts? - builder.where("p.deleted_at is null and p2.deleted_at is null and t.deleted_at is null") + builder.where("p.deleted_at is null and p2.deleted_at is null") current_user_id = -2 current_user_id = guardian.user.id if guardian.user