Sha256: 7ddd41c6da79336d127c5ee7a83d2d1c071e23b724c027352bb602d3e5d9f218
Contents?: true
Size: 731 Bytes
Versions: 135
Compression:
Stored size: 731 Bytes
Contents
module CanvasSync module Importers class LegacyImporter # Does a legacy style import, row by row. This will be invoked if you passed # "legacy_support: true" when starting the sync. For this to work your models # must have a `create_or_update_from_csv` class method defined. # # @param report_file_path [String] # @param klass [Object] def self.import(report_file_path, klass, account_id, options) ClassCallbackExecutor.run_if_defined(klass, :sync_import) do CSV.foreach(report_file_path, headers: true, header_converters: :symbol) do |row| klass.create_or_update_from_csv(row, account_id, options) end end end end end end
Version data entries
135 entries across 135 versions & 1 rubygems