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:
Sam Saffron 2019-11-14 13:15:00 +11:00
parent a2fff39e6c
commit f8832f209c
1 changed files with 2 additions and 2 deletions

View File

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