#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 >=.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user