From be7732651c0e4762eecfb0100fa9ba571336b282 Mon Sep 17 00:00:00 2001 From: albert Date: Fri, 1 Jun 2012 14:54:26 -0400 Subject: [PATCH] add source:none --- app/logical/post_query_builder.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/logical/post_query_builder.rb b/app/logical/post_query_builder.rb index 48a03ed7a..ed98a70dd 100644 --- a/app/logical/post_query_builder.rb +++ b/app/logical/post_query_builder.rb @@ -138,8 +138,12 @@ class PostQueryBuilder end if q[:source] - relation = relation.where("posts.source LIKE ? ESCAPE E'\\\\'", q[:source]) - has_constraints! + if q[:source] == "none" + relation = relation.where("(posts.source = '' OR posts.source IS NULL)") + else + relation = relation.where("posts.source LIKE ? ESCAPE E'\\\\'", q[:source]) + has_constraints! + end end if q[:subscriptions]