FIX: post_actions from deleted users should not show up in the old flags section

This commit is contained in:
Régis Hanol 2014-08-04 22:51:33 +02:00
parent ec30086dea
commit 458c0c67a3
1 changed files with 2 additions and 0 deletions

View File

@ -110,6 +110,8 @@ module FlagQuery
post_actions = PostAction.flags
.joins("INNER JOIN posts ON posts.id = post_actions.post_id")
.joins("INNER JOIN topics ON topics.id = posts.topic_id")
.joins("LEFT JOIN users ON users.id = posts.user_id")
.where("users.id IS NOT NULL")
if filter == "old"
post_actions.where("post_actions.disagreed_at IS NOT NULL OR