Class: Spina::Admin::Conferences::ImportJob
- Inherits:
-
ApplicationJob
- Object
- ActiveJob::Base
- ApplicationJob
- Spina::Admin::Conferences::ImportJob
- Defined in:
- app/jobs/spina/admin/conferences/import_job.rb
Overview
Job for importing CSV files.
Direct Known Subclasses
Instance Method Summary collapse
-
#import(file) {|row| ... } ⇒ Object
Performs the job.
Instance Method Details
#import(file) {|row| ... } ⇒ Object
Performs the job.
19 20 21 22 |
# File 'app/jobs/spina/admin/conferences/import_job.rb', line 19 def import(file) csv_rows = CSV.parse file, encoding: 'UTF-8', headers: true, header_converters: :symbol, converters: [:json] csv_rows.each { |row| yield(row) } end |