Sha256: 38ce19d6787642908bbbf75ee6f4b1670f8f9bfd46dc7c9d73893cef87d50dc0

Contents?: true

Size: 514 Bytes

Versions: 2

Compression:

Stored size: 514 Bytes

Contents

require "parse/db/import/utils"

module Parse
  module Db
    class Import
      def import_data(options)
        Dir["#{options.path}/#{options.entity}/data.json"].each do |file|
          klass = klass_from_file(file)
          puts "Importing....#{klass.name}"
          process_parse_file(file) do |record|
            begin
              klass.new(record).save!()
            rescue Exception
              puts record
              raise
            end
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
parse-db-import-0.0.2 lib/parse/db/import/import_data.rb
parse-db-import-0.0.1 lib/parse/db/import/import_data.rb