forum: optimize unread forum topics on forum index.
Avoid doing one SQL query per topic when checking for new topics on the forum index. This also changes it so that forum topics aren't always marked as new for anonymous users.
This commit is contained in:
@@ -6,4 +6,8 @@ module ForumTopicsHelper
|
||||
def available_min_user_levels
|
||||
ForumTopic::MIN_LEVELS.select { |name, level| level <= CurrentUser.level }.to_a
|
||||
end
|
||||
|
||||
def new_forum_topic?(topic, read_forum_topics)
|
||||
!read_forum_topics.map(&:id).include?(topic.id)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user