Fix status:active so that it doesn't show flagged posts

This commit is contained in:
BrokenEagle
2017-12-28 12:16:44 -08:00
parent b48d5e59ad
commit 7c9dd80d35

View File

@@ -137,7 +137,7 @@ class PostQueryBuilder
elsif q[:status] == "banned"
relation = relation.where("posts.is_banned = TRUE")
elsif q[:status] == "active"
relation = relation.where("posts.is_pending = FALSE AND posts.is_deleted = FALSE AND posts.is_banned = FALSE")
relation = relation.where("posts.is_pending = FALSE AND posts.is_deleted = FALSE AND posts.is_banned = FALSE AND posts.is_flagged = FALSE")
elsif q[:status] == "all" || q[:status] == "any"
# do nothing
elsif q[:status_neg] == "pending"
@@ -149,7 +149,7 @@ class PostQueryBuilder
elsif q[:status_neg] == "banned"
relation = relation.where("posts.is_banned = FALSE")
elsif q[:status_neg] == "active"
relation = relation.where("posts.is_pending = TRUE OR posts.is_deleted = TRUE OR posts.is_banned = TRUE")
relation = relation.where("posts.is_pending = TRUE OR posts.is_deleted = TRUE OR posts.is_banned = TRUE OR posts.is_flagged = TRUE")
end
if hide_deleted_posts?(q)