Skip to content

A platform for community discussion. Free, open, simple.

FIX: remove unnecessary OR from dismiss service (#12117)

Krzysztof Kotlarek2f4630742c6e
diff --git a/app/services/dismiss_topics.rb b/app/services/dismiss_topics.rb
index eb2e05b44ca..595fdf92d1d 100644
--- a/app/services/dismiss_topics.rb
+++ b/app/services/dismiss_topics.rb
@@ -17,7 +17,7 @@ class DismissTopics
@rows ||= @topics_scope
.joins("LEFT JOIN topic_users ON topic_users.topic_id = topics.id AND topic_users.user_id = #{@user.id}")
.where("topics.created_at >= ?", since_date)
- .where("topic_users.id IS NULL OR topic_users.last_read_post_number IS NULL")
+ .where("topic_users.last_read_post_number IS NULL")
.where("topics.archetype <> ?", Archetype.private_message)
.order("topics.created_at DESC")
.limit(SiteSetting.max_new_topics).map do |topic|