Class: Decidim::ProcessInactiveParticipantJob

Inherits:
ApplicationJob
  • Object
show all
Defined in:
app/jobs/decidim/process_inactive_participant_job.rb

Overview

A job to process a single inactive participant

Instance Method Summary collapse

Instance Method Details

#perform(user_id, action) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/jobs/decidim/process_inactive_participant_job.rb', line 8

def perform(user_id, action, *)
  user = Decidim::User.find_by(id: user_id)
  return unless user

  case action.to_sym
  when :clear_notification
    user.extended_data.delete("inactivity_notification")
    user.save!
  when :send_warning
    process_send_warning(user, *)
  when :remove
    process_remove_user(user)
  end
end