Class: CanvasSync::Processors::ReportProcessor

Inherits:
Object
  • Object
show all
Defined in:
lib/canvas_sync/processors/report_processor.rb

Overview

Base report processing class

Instance Method Summary collapse

Instance Method Details

#do_bulk_import(report_file_path, model, options: {}, mapping_key: nil, &blk) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/canvas_sync/processors/report_processor.rb', line 15

def do_bulk_import(report_file_path, model, options: {}, mapping_key: nil, &blk)
  m = mapping_for(model, mapping_key)
  CanvasSync::Importers::BulkImporter.import(
    report_file_path,
    m[:columns],
    model,
    m[:conflict_target],
    import_args: options,
    &blk
  )
end

#mappingObject



7
8
9
# File 'lib/canvas_sync/processors/report_processor.rb', line 7

def mapping
  CanvasSync::Concerns::SyncMapping::Mapping.default_mappings
end

#mapping_for(model, key = nil) ⇒ Object



11
12
13
# File 'lib/canvas_sync/processors/report_processor.rb', line 11

def mapping_for(model, key = nil)
  CanvasSync::Concerns::SyncMapping.mapping_for(model, key)
end