Sha256: f55a152abefa87a05ecb50163966c5c37b48aa3c78e7b08793e199d8f6bb1133
Contents?: true
Size: 769 Bytes
Versions: 7
Compression:
Stored size: 769 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[:report_columns], model, m[:conflict_target], import_args: options, &blk ) end end end end
Version data entries
7 entries across 7 versions & 1 rubygems