WIP: Tags which are not allowed in a category showing in drop down.

This commit is contained in:
Guo Xiang Tan
2016-07-07 21:17:56 +08:00
parent 323efcab71
commit 8fd0414cdf
9 changed files with 70 additions and 28 deletions

View File

@ -9,7 +9,6 @@ require_dependency 'topic_query_sql'
require_dependency 'avatar_lookup'
class TopicQuery
# Could be rewritten to %i if Ruby 1.9 is no longer supported
VALID_OPTIONS = %i(except_topic_ids
exclude_category_ids
limit
@ -460,7 +459,6 @@ class TopicQuery
if @options[:tags] && @options[:tags].size > 0
result = result.joins(:tags)
# ANY of the given tags:
if @options[:tags][0].is_a?(Integer)
result = result.where("tags.id in (?)", @options[:tags])