diff --git a/Gemfile_rails4.lock b/Gemfile_rails4.lock index 7e174087f05..5989d7838e3 100644 --- a/Gemfile_rails4.lock +++ b/Gemfile_rails4.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/dysania/onebox.git - revision: 3a96eb87c548baf8161362b6b36b58026b5a3946 + revision: 6a2f6e6a08f183a4df52f9a51187f566b8ae3a00 specs: onebox (1.1.0) hexpress (~> 1.2) diff --git a/app/models/category_featured_topic.rb b/app/models/category_featured_topic.rb index 2704aff8491..6ffe0fb6d30 100644 --- a/app/models/category_featured_topic.rb +++ b/app/models/category_featured_topic.rb @@ -20,7 +20,7 @@ class CategoryFeaturedTopic < ActiveRecord::Base def self.feature_topics_for(c, existing=nil) return if c.blank? - query = TopicQuery.new(self.fake_admin, per_page: SiteSetting.category_featured_topics, except_topic_ids: [c.topic_id], visible: true) + query = TopicQuery.new(self.fake_admin, per_page: SiteSetting.category_featured_topics, except_topic_ids: [c.topic_id], visible: true, no_definitions: true) results = query.list_category(c).topic_ids return if results == existing diff --git a/lib/topic_query.rb b/lib/topic_query.rb index f0b097e108c..57dd477cf07 100644 --- a/lib/topic_query.rb +++ b/lib/topic_query.rb @@ -19,6 +19,7 @@ class TopicQuery sort_order no_subcategories sort_descending + no_definitions status).map(&:to_sym) # Maps `sort_order` to a columns in `topics` @@ -240,7 +241,7 @@ class TopicQuery result = result.where('categories.name is null or categories.name <> ?', options[:exclude_category]).references(:categories) if options[:exclude_category] # Don't include the category topic unless restricted to that category - if options[:category].blank? + if options[:category].blank? || options[:no_definitions] result = result.where('COALESCE(categories.topic_id, 0) <> topics.id') end