Sha256: de9eba5d887071f0e431813612a6d71188e1af45f3e7d81d9fa9cf1e13b95b1a

Contents?: true

Size: 543 Bytes

Versions: 21

Compression:

Stored size: 543 Bytes

Contents

# frozen_string_literal: true
module Thredded
  class ActivityUpdaterJob < ::ActiveJob::Base
    queue_as :default

    def perform(user_id, messageboard_id)
      now = Time.current

      user_detail = Thredded::UserDetail.find_or_initialize_by(user_id: user_id)
      user_detail.update!(last_seen_at: now)

      Thredded::MessageboardUser
        .find_or_initialize_by(
          thredded_messageboard_id: messageboard_id,
          thredded_user_detail_id: user_detail.id
        )
        .update!(last_seen_at: now)
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
thredded-0.12.1 app/jobs/thredded/activity_updater_job.rb
thredded-0.12.0 app/jobs/thredded/activity_updater_job.rb
thredded-0.11.1 app/jobs/thredded/activity_updater_job.rb
thredded-0.11.0 app/jobs/thredded/activity_updater_job.rb
thredded-0.10.1 app/jobs/thredded/activity_updater_job.rb
thredded-0.10.0 app/jobs/thredded/activity_updater_job.rb
thredded-0.9.4 app/jobs/thredded/activity_updater_job.rb
thredded-0.9.3 app/jobs/thredded/activity_updater_job.rb
thredded-0.9.2 app/jobs/thredded/activity_updater_job.rb
thredded-0.9.1 app/jobs/thredded/activity_updater_job.rb
thredded-0.8.4 app/jobs/thredded/activity_updater_job.rb
thredded-0.8.2 app/jobs/thredded/activity_updater_job.rb
thredded-0.7.0 app/jobs/thredded/activity_updater_job.rb
thredded-0.6.3 app/jobs/thredded/activity_updater_job.rb
thredded-0.6.2 app/jobs/thredded/activity_updater_job.rb
thredded-0.6.1 app/jobs/thredded/activity_updater_job.rb
thredded-0.6.0 app/jobs/thredded/activity_updater_job.rb
thredded-0.5.1 app/jobs/thredded/activity_updater_job.rb
thredded-0.5.0 app/jobs/thredded/activity_updater_job.rb
thredded-0.4.0 app/jobs/thredded/activity_updater_job.rb