Class: Decidim::ActionDelegator::SyncParticipantsJob

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

Instance Method Summary collapse

Instance Method Details

#perform(setting) ⇒ Object



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

def perform(setting)
  @setting = setting

  return unless setting&.participants

  setting.participants.each do |participant|
    next if participant.decidim_user.present?
    next if participant..blank?

    participant.decidim_user = participant.
    participant.save
  end
end