forum: fix exception in forum_topics/new.
Caused by including is_read? in html_data_attributes. updated_at is nil for new topics.
This commit is contained in:
@@ -136,6 +136,7 @@ class ForumTopic < ApplicationRecord
|
||||
# XXX forum_topic_visit_by_current_user is a hack to reduce queries on the forum index.
|
||||
def is_read?
|
||||
return true if CurrentUser.is_anonymous?
|
||||
return true if new_record?
|
||||
|
||||
topic_last_read_at = forum_topic_visit_by_current_user&.last_read_at || "2000-01-01".to_time
|
||||
forum_last_read_at = CurrentUser.last_forum_read_at || "2000-01-01".to_time
|
||||
|
||||
Reference in New Issue
Block a user