2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-07 12:02:53 +08:00

only show topics that have activity in top page

This commit is contained in:
Régis Hanol 2013-12-24 15:26:03 +01:00
parent 91db466196
commit cb6d83943a

View file

@ -85,8 +85,11 @@ class TopicQuery
end
def list_top(sort_order, period)
count = "#{period}_#{sort_order}_count"
create_list(:top, unordered: true) do |topics|
topics.joins(:top_topic).order("top_topics.#{period}_#{sort_order}_count DESC, topics.bumped_at DESC")
topics.joins(:top_topic)
.where("top_topics.#{count} > 0")
.order("top_topics.#{count} DESC, topics.bumped_at DESC")
end
end