correct random suggested topic selection

This commit is contained in:
Sam
2016-07-04 10:34:54 +10:00
parent e858def372
commit 92daf44daf
4 changed files with 23 additions and 20 deletions
-4
View File
@@ -25,10 +25,6 @@ class SuggestedTopicsBuilder
if @category_id && SiteSetting.limit_suggested_to_category?
results = results.where(category_id: @category_id)
end
# Suggested topics should not be more than n days old
results = results.where("topics.created_at > ?", SiteSetting.suggested_topics_max_days_old.days.ago)
results = results.to_a.reject { |topic| @category_topic_ids.include?(topic.id) }
unless results.empty?