Digest should exclude muted topics.
This commit is contained in:
parent
89aa2380c6
commit
564b1d86b0
|
@ -266,10 +266,12 @@ class Topic < ActiveRecord::Base
|
|||
topics = Topic
|
||||
.visible
|
||||
.secured(Guardian.new(user))
|
||||
.joins("LEFT OUTER JOIN top_topics ON top_topics.topic_id = topics.id")
|
||||
.joins("LEFT OUTER JOIN topic_users ON topic_users.topic_id = topics.id AND topic_users.user_id = #{user.id.to_i}")
|
||||
.where(closed: false, archived: false)
|
||||
.where("COALESCE(topic_users.notification_level, 1) <> ?", TopicUser.notification_levels[:muted])
|
||||
.created_since(since)
|
||||
.listable_topics
|
||||
.joins("LEFT OUTER JOIN top_topics ON top_topics.topic_id = topics.id")
|
||||
.order(TopicQuerySQL.order_top_for(score))
|
||||
.limit(100)
|
||||
|
||||
|
|
Loading…
Reference in New Issue