Class: Spina::Admin::Conferences::PresentationImportJob

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

Overview

Job for importing Presentation 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.

    session_id

    The id of the associated session.

    start_datetime

    The start time of the presentation, in ISO 8601 format.

    title

    The title of the presentation for the default locale.

    abstract

    The presentation’s abstract.

    presenter_ids

    The ids of the presenters.



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

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