activeadmin-plugins/active_admin_import

Name: active_admin_import

Owner: Active Admin Plugins

Description: :paperclip: active_admin_import is based on activerecord-import gem - the most efficient way to import for ActiveAdmin

Created: 2013-03-06 16:33:45.0

Updated: 2018-01-21 04:45:13.0

Pushed: 2017-11-01 06:40:08.0

Homepage: http://activeadmin-plugins.github.io/active_admin_import

Size: 201

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

ActiveAdminImport

The most fastest and efficient CSV import for Active Admin with support of validations, bulk inserts and encodings handling

Build Status Dependency Status Coverage Status Code Climate Gem Version License

Installation

Add this line to your application's Gemfile:

"active_admin_import" , '3.0.0'

or

"active_admin_import" , github: "activeadmin-plugins/active_admin_import"

And then execute:

$ bundle

active_admin_import features

  1. Replacements/Updates support
  2. Encoding handling
  3. CSV options
  4. Ability to describe/change CSV headers
  5. Bulk import (activerecord-import)
  6. Callbacks
  7. Zip files
  8. and more...
Basic usage
veAdmin.register Post
tive_admin_import options

Options

Tool | Description ——————— | ———– :back |resource action to redirect after processing :csv_options |hash with column separator, row separator, etc :validate |bool means perform validations or not :batch_size |integer value of max record count inserted by 1 query/transaction :batch_transaction |bool (false by default), if transaction is used when batch importing and works when :validate is set to true :before_import |proc for before import action, hook called with importer object :after_import |proc for after import action, hook called with importer object :before_batch_import |proc for before each batch action, called with importer object :after_batch_import |proc for after each batch action, called with importer object :on_duplicate_key_update|an Array or Hash, tells activerecord-import to use MySQL's ON DUPLICATE KEY UPDATE or Postgres 9.5+ ON CONFLICT DO UPDATE ability. :timestamps |bool, tells activerecord-import to not add timestamps (if false) even if record timestamps is disabled in ActiveRecord::Base :ignore |bool, tells activerecord-import to use MySQL's INSERT IGNORE ability :template |custom template rendering :template_object |object passing to view :resource_class |resource class name :resource_label |resource label value :plural_resource_label |pluralized resource label value (default config.plural_resource_label) :error_limit |Limit the number of errors reported (default 5, set to nil for all) :headers_rewrites |hash with key (csv header) - value (db column name) rows mapping :if |Controls whether the 'Import' button is displayed. It supports a proc to be evaluated into a boolean value within the activeadmin render context.

Wiki

Check various examples

Dependencies

Tool | Description ——————— | ———– rchardet | Character encoding auto-detection in Ruby. As smart as your browser. Open source. activerecord-import | Powerful library for bulk inserting data using ActiveRecord.

Contributing
  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.