From 4d8ed12cc473b799cbf96d2c986203343d837dec Mon Sep 17 00:00:00 2001 From: Toks Date: Thu, 30 May 2013 16:18:29 -0400 Subject: [PATCH] fix for #1047 --- app/logical/post_query_builder.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/logical/post_query_builder.rb b/app/logical/post_query_builder.rb index 9eaf29a6a..0e467d2ce 100644 --- a/app/logical/post_query_builder.rb +++ b/app/logical/post_query_builder.rb @@ -141,9 +141,11 @@ class PostQueryBuilder relation = relation.where("posts.is_deleted = TRUE") 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") elsif q[:status] == "all" || q[:status] == "any" # do nothing - elsif q[:status_neg] == "pending" || q[:status] == "active" + elsif q[:status_neg] == "pending" relation = relation.where("posts.is_pending = FALSE") elsif q[:status_neg] == "flagged" relation = relation.where("posts.is_flagged = FALSE")