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

Version Path
canvas_sync-0.21.0.beta5 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.21.0.beta4 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.21.0.beta3 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.21.0.beta2 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.21.0.beta1 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.20.5 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.20.4 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.20.3 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.19.1.beta2 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.19.1.beta1 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.19.0 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.19.0.beta10 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.19.0.beta9 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.19.0.beta8 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.19.0.beta7 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.19.0.beta6 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.19.0.beta5 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.19.0.beta4 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.19.0.beta3 lib/canvas_sync/importers/legacy_importer.rb
canvas_sync-0.19.0.beta2 lib/canvas_sync/importers/legacy_importer.rb