Sha256: 6dc435df8c6c4966b0a9aacc2d02157bfa93891b6dd1c63dbebc92fb05de870f

Contents?: true

Size: 644 Bytes

Versions: 14

Compression:

Stored size: 644 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)
        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

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
canvas_sync-0.11.1 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.12.0 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.11.0 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.10.6 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.10.5 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.10.4 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.10.3 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.10.2 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.10.0 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.9.4 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.9.3 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.9.2 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.9.1 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.9.0 lib/canvas_sync/importers/legacy_importer.rb