Class: Spina::Admin::Conferences::DelegateImportJob

Inherits:
ImportJob show all
Defined in:
app/jobs/spina/admin/conferences/delegate_import_job.rb

Overview

Job for importing Delegate objects.

See Also:

Instance Method Summary collapse

Methods inherited from ImportJob

#import

Instance Method Details

#perform(csv) ⇒ void

This method returns an undefined value.

Performs the job.

Parameters:

  • csv (String)

    the UTF-8-encoded string to parse as a CSV

    Columns

    The CSV should has the following columns. Make sure to include the column names in the header row.

    first_name

    The first name of the delegate.

    last_name

    The last name of the delegate.

    email_address

    The email address of the delegate.

    institution_id

    The id of the current institution of the delegate.

    dietary_requirement_ids

    The ids of the dietary requirements of the delegate.



22
23
24
25
26
# File 'app/jobs/spina/admin/conferences/delegate_import_job.rb', line 22

def perform(csv)
  Delegate.transaction do
    import(csv) { |row| Delegate.create! delegate_params(row.to_h) }
  end
end