add source:none

This commit is contained in:
albert
2012-06-01 14:54:26 -04:00
parent 8b2ac0cb70
commit be7732651c

View File

@@ -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]