This commit is contained in:
Toks
2013-10-09 14:11:38 -04:00
parent fed48da2df
commit 34716298b6
2 changed files with 13 additions and 1 deletions

View File

@@ -190,6 +190,12 @@ class PostQueryBuilder
end
end
if q[:pool] == "none"
relation = relation.where("posts.pool_string = ''")
elsif q[:pool] == "any"
relation = relation.where("posts.pool_string != ''")
end
if q[:subscriptions]
relation = add_tag_subscription_relation(q[:subscriptions], relation)
has_constraints!

View File

@@ -379,7 +379,13 @@ class Tag < ActiveRecord::Base
q[:tags][:exclude] << "pool:#{Pool.name_to_id($2)}"
when "pool"
q[:tags][:related] << "pool:#{Pool.name_to_id($2)}"
if $2.downcase == "none"
q[:pool] = "none"
elsif $2.downcase == "any"
q[:pool] = "any"
else
q[:tags][:related] << "pool:#{Pool.name_to_id($2)}"
end
when "-fav"
q[:tags][:exclude] << "fav:#{User.name_to_id($2)}"