FEATURE: exclude muted categories from the "top" topics list.
This commit is contained in:
@@ -265,6 +265,7 @@ class TopicQuery
|
||||
def list_top_for(period)
|
||||
score = "#{period}_score"
|
||||
create_list(:top, unordered: true) do |topics|
|
||||
topics = remove_muted_categories(topics, @user)
|
||||
topics = topics.joins(:top_topic).where("top_topics.#{score} > 0")
|
||||
if period == :yearly && @user.try(:trust_level) == TrustLevel[0]
|
||||
topics.order(TopicQuerySQL.order_top_with_pinned_category_for(score))
|
||||
|
||||
Reference in New Issue
Block a user