FIX: Core changed internals and now topics is not implicit
Be explicit about the name of the table we are using, multiple tables may have the category_id column
This commit is contained in:
parent
a2fff39e6c
commit
f8832f209c
|
@ -21,11 +21,11 @@ module KnowledgeExplorer
|
|||
tq = TopicQuery.new(@user)
|
||||
results = tq.latest_results(no_definitions: true, limit: false)
|
||||
results = results.left_outer_joins(:tags)
|
||||
results = results.where('category_id IN (?)', Query.categories).or(results.where('tags.name IN (?)', Query.tags))
|
||||
results = results.where('topics.category_id IN (?)', Query.categories).or(results.where('tags.name IN (?)', Query.tags))
|
||||
|
||||
# filter results by selected category
|
||||
if @filters[:category].present?
|
||||
results = results.where('category_id IN (?)', @filters[:category].split('|'))
|
||||
results = results.where('topics.category_id IN (?)', @filters[:category].split('|'))
|
||||
end
|
||||
|
||||
# filter results by selected tags
|
||||
|
|
Loading…
Reference in New Issue