Sha256: 2cc2145a7ecfb0b4332f3a16bb5c259a786f4a60df66be8c2e2f5ff1cdaed11f
Contents?: true
Size: 494 Bytes
Versions: 14
Compression:
Stored size: 494 Bytes
Contents
# frozen_string_literal: true module Thredded class MarkAllRead def self.run(user) unread_topics = Thredded::PrivateTopic.unread(user) return if unread_topics.empty? unread_topics.each do |topic| last_post = topic.posts.order_oldest_first.last total_pages = topic.posts.page(1).total_pages UserPrivateTopicReadState.touch!( user.id, topic.id, last_post, total_pages ) end end end end
Version data entries
14 entries across 14 versions & 1 rubygems