diff --git a/lib/knowledge_explorer/query.rb b/lib/knowledge_explorer/query.rb index 3348bee..7a0fa16 100644 --- a/lib/knowledge_explorer/query.rb +++ b/lib/knowledge_explorer/query.rb @@ -18,9 +18,11 @@ module KnowledgeExplorer def list # query for topics matching selected categories & tags - tq = TopicQuery.new(@user) - results = tq.latest_results(no_definitions: true, limit: false) + opts = { no_definitions: true, limit: false } + tq = TopicQuery.new(@user, opts) + results = tq.list_knowledge_explorer_topics results = results.left_outer_joins(:tags) + results = results.references(:categories) results = results.where('topics.category_id IN (?)', Query.categories).or(results.where('tags.name IN (?)', Query.tags)) # filter results by selected category diff --git a/plugin.rb b/plugin.rb index c67aa98..21e023c 100644 --- a/plugin.rb +++ b/plugin.rb @@ -34,4 +34,7 @@ after_initialize do end end end + add_to_class(:topic_query, :list_knowledge_explorer_topics) do + default_results(@options) + end end