Class: BulkOps::CreateSpreadsheetJob
- Inherits:
-
ActiveJob::Base
- Object
- ActiveJob::Base
- BulkOps::CreateSpreadsheetJob
- Defined in:
- lib/bulk_ops/create_spreadsheet_job.rb
Instance Method Summary collapse
Instance Method Details
#perform(branch_name, work_ids, fields, user) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/bulk_ops/create_spreadsheet_job.rb', line 5 def perform(branch_name, work_ids, fields, user) csv_file = Tempfile.new('bulk_ops_metadata') csv_file.write(fields.join(',')) work_ids.each do |work_id| if work_csv = work_to_csv(work_id,fields) csv_file.write("\r\n" + work_csv) end end csv_file.close BulkOps::GithubAccess.new(branch_name, user).add_new_spreadsheet(csv_file.path) csv_file.unlink end |