Sha256: 15f903b313642176535ef7d8496dc45a5bf375577befe6f973ab6a025c4b3c6e
Contents?: true
Size: 747 Bytes
Versions: 16
Compression:
Stored size: 747 Bytes
Contents
require "yaml" module CanvasSync module Processors # Base report processing class class ReportProcessor def mapping CanvasSync::Concerns::SyncMapping::Mapping.default_mappings end def mapping_for(model, key = nil) model.try(:get_sync_mapping, key) || mapping[key || CanvasSync::Concerns::SyncMapping::Mapping.normalize_model_name(model)] end def do_bulk_import(report_file_path, model, options: {}, mapping_key: nil) m = mapping_for(model, mapping_key) CanvasSync::Importers::BulkImporter.import( report_file_path, m[:report_columns], model, m[:conflict_target], import_args: options ) end end end end
Version data entries
16 entries across 16 versions & 1 rubygems