mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Suggested topics includes closed and archived in new and unread, but not in random results
This commit is contained in:
@@ -19,7 +19,7 @@ class SuggestedTopicsBuilder
|
||||
|
||||
# Only add results if we don't have those topic ids already
|
||||
results = results.where('topics.id NOT IN (?)', @excluded_topic_ids)
|
||||
.where(closed: false, archived: false, visible: true)
|
||||
.where(visible: true)
|
||||
.to_a
|
||||
.reject { |topic| @category_topic_ids.include?(topic.id) }
|
||||
|
||||
|
||||
@@ -309,7 +309,7 @@ class TopicQuery
|
||||
end
|
||||
|
||||
def random_suggested(topic, count, excluded_topic_ids=[])
|
||||
result = default_results(unordered: true, per_page: count)
|
||||
result = default_results(unordered: true, per_page: count).where(closed: false, archived: false)
|
||||
excluded_topic_ids += Category.pluck(:topic_id).compact
|
||||
result = result.where("topics.id NOT IN (?)", excluded_topic_ids) unless excluded_topic_ids.empty?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user