Class: CanvasSync::Jobs::SyncAssignmentOverridesJob

Inherits:
ReportSyncTask show all
Defined in:
lib/canvas_sync/jobs/sync_assignment_overrides_job.rb

Constant Summary

Constants inherited from ReportSyncTask

ReportSyncTask::AUTO_MODEL_REGEX, ReportSyncTask::COMPILATION_TIMEOUT, ReportSyncTask::MAX_TRIES, ReportSyncTask::REPORT_TIMEOUT

Instance Attribute Summary

Attributes inherited from ReportSyncTask

#context, #options, #state

Instance Method Summary collapse

Methods inherited from ReportSyncTask

#caching_key, #check_frequency, from_context, #initialize, #max_tries, merge_report_params, model, perform_later, perform_now, report_name, #report_name, #report_parameters

Constructor Details

This class inherits a constructor from CanvasSync::Jobs::ReportSyncTask

Instance Method Details

#process(report_file_path) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/canvas_sync/jobs/sync_assignment_overrides_job.rb', line 6

def process(report_file_path)
  do_bulk_import(report_file_path, AssignmentOverride) do |row|
    # Handle transforms here instead of in mappings
    row[:student_ids]       = parse_student_ids(row[:student_ids])

    # Convert empty/null/'0' values to nil
    # For Ruby 2.7
    row[:group_id]          = parse_nil_value(row[:group_id])
    row[:course_section_id] = parse_nil_value(row[:course_section_id])
    row
  end
end