From 8541d2896a8e6d1cdaeebbfe238945af0191624b Mon Sep 17 00:00:00 2001 From: Toks Date: Wed, 26 Mar 2014 14:21:34 -0400 Subject: [PATCH] #1469: Fix issue with topics getting marked as read erroneously It looks like it would set last_forum_read_at to the oldest unread topic's updated_at value. But then it would fail to include that same topic in the query next time because it used > instead of >=. --- app/models/forum_topic.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/forum_topic.rb b/app/models/forum_topic.rb index db0451fca..7f1ae3950 100644 --- a/app/models/forum_topic.rb +++ b/app/models/forum_topic.rb @@ -135,7 +135,7 @@ class ForumTopic < ActiveRecord::Base def update_last_forum_read_at(read_forum_topic_ids) query = ForumTopic.scoped if CurrentUser.user.last_forum_read_at.present? - query = query.where("updated_at > ?", CurrentUser.last_forum_read_at) + query = query.where("updated_at >= ?", CurrentUser.last_forum_read_at) end if read_forum_topic_ids.any? query = query.where("id not in (?)", read_forum_topic_ids)