Sha256: e29c2831484e7c33a65ad7ef86ff1b96b7b703fe408aad508539b873c0a5544c

Contents?: true

Size: 544 Bytes

Versions: 18

Compression:

Stored size: 544 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

18 entries across 18 versions & 2 rubygems

Version Path
threddedDANIEL-0.14.5 app/jobs/thredded/activity_updater_job.rb
thredded-0.14.4 app/jobs/thredded/activity_updater_job.rb
thredded-0.14.3 app/jobs/thredded/activity_updater_job.rb
thredded-0.14.2 app/jobs/thredded/activity_updater_job.rb
thredded-0.14.1 app/jobs/thredded/activity_updater_job.rb
thredded-0.14.0 app/jobs/thredded/activity_updater_job.rb
thredded-0.13.8 app/jobs/thredded/activity_updater_job.rb
thredded-0.13.7 app/jobs/thredded/activity_updater_job.rb
thredded-0.13.6 app/jobs/thredded/activity_updater_job.rb
thredded-0.13.5 app/jobs/thredded/activity_updater_job.rb
thredded-0.13.4 app/jobs/thredded/activity_updater_job.rb
thredded-0.13.3 app/jobs/thredded/activity_updater_job.rb
thredded-0.13.2 app/jobs/thredded/activity_updater_job.rb
thredded-0.13.1 app/jobs/thredded/activity_updater_job.rb
thredded-0.13.0 app/jobs/thredded/activity_updater_job.rb
thredded-0.12.4 app/jobs/thredded/activity_updater_job.rb
thredded-0.12.3 app/jobs/thredded/activity_updater_job.rb
thredded-0.12.2 app/jobs/thredded/activity_updater_job.rb