Sha256: f423087a9a8296ba2a26d86642f3d6ed9b8fe12a3a290f334d034b5d6ca49cc6
Contents?: true
Size: 762 Bytes
Versions: 12
Compression:
Stored size: 762 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, &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 end end end
Version data entries
12 entries across 12 versions & 1 rubygems