From aa1443da6eac984d15a31129e22581358b0871b2 Mon Sep 17 00:00:00 2001 From: albert Date: Wed, 26 Oct 2011 18:40:25 -0400 Subject: [PATCH] fixes #162: Excluded tag searches (i.e. -tag) don't work alone or with metatags. --- app/models/post.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/models/post.rb b/app/models/post.rb index a34888739..d170d2391 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -559,11 +559,7 @@ class Post < ActiveRecord::Base if tags[:exclude].any? raise SearchError.new("You cannot search for more than #{Danbooru.config.tag_query_limit} tags at a time") if tags[:exclude].size > Danbooru.config.tag_query_limit - if tags[:related].any? || tags[:include].any? - tag_query_sql << "!(" + escape_string_for_tsquery(tags[:exclude]).join(" | ") + ")" - else - raise SearchError.new("You cannot search for only excluded tags") - end + tag_query_sql << "!(" + escape_string_for_tsquery(tags[:exclude]).join(" | ") + ")" end if tag_query_sql.any?