Sha256: 31473e5b2cd1ffe5ead43d4e4cdd52327a936f8bd19ba7c1bdd5bfae775b563c

Contents?: true

Size: 626 Bytes

Versions: 48

Compression:

Stored size: 626 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)
        CSV.foreach(report_file_path, headers: true, header_converters: :symbol) do |row|
          klass.create_or_update_from_csv(row, account_id)
        end
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
canvas_sync-0.8.4 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.8.3 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.8.2 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.8.1 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.8.0 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.7.3 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.7.2 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.7.1 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.7.0 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.6.4 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.6.3 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.6.2 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.6.1 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.6.0 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.5.4 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.5.3 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.5.2 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.5.1 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.4.1 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.4.0 lib/canvas_sync/importers/legacy_importer.rb