From 2f4630742c6e8f4df92f859e2843071c9a75ca74 Mon Sep 17 00:00:00 2001 From: Krzysztof Kotlarek Date: Thu, 18 Feb 2021 14:55:58 +1100 Subject: [PATCH] FIX: remove unnecessary OR from dismiss service (#12117) Quick fix after https://github.com/discourse/discourse/pull/12103 --- app/services/dismiss_topics.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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|