Sha256: e1cbf4317d1cb18856e4db082313820543688944365329856827089ab8a0293f

Contents?: true

Size: 310 Bytes

Versions: 19

Compression:

Stored size: 310 Bytes

Contents

# frozen_string_literal: true

module Thredded
  # Marks all private topics as read for the given user.
  class MarkAllRead
    def self.run(user)
      Thredded::PrivateTopic.unread(user).each do |topic|
        Thredded::UserPrivateTopicReadState.touch!(user.id, topic.last_post)
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
thredded-1.1.0 app/commands/thredded/mark_all_read.rb
thredded-1.0.1 app/commands/thredded/mark_all_read.rb
thredded-1.0.0 app/commands/thredded/mark_all_read.rb
thredded-0.16.16 app/commands/thredded/mark_all_read.rb
thredded-0.16.15 app/commands/thredded/mark_all_read.rb
thredded-0.16.14 app/commands/thredded/mark_all_read.rb
thredded-0.16.13 app/commands/thredded/mark_all_read.rb
thredded-0.16.12 app/commands/thredded/mark_all_read.rb
thredded-0.16.11 app/commands/thredded/mark_all_read.rb
thredded-0.16.10 app/commands/thredded/mark_all_read.rb
thredded-0.16.9 app/commands/thredded/mark_all_read.rb
thredded-0.16.8 app/commands/thredded/mark_all_read.rb
thredded-0.16.7 app/commands/thredded/mark_all_read.rb
thredded-0.16.6 app/commands/thredded/mark_all_read.rb
thredded-0.16.5 app/commands/thredded/mark_all_read.rb
thredded-0.16.4 app/commands/thredded/mark_all_read.rb
thredded-0.16.3 app/commands/thredded/mark_all_read.rb
thredded-0.16.1 app/commands/thredded/mark_all_read.rb
thredded-0.16.0 app/commands/thredded/mark_all_read.rb