active_admin_import 4.0.0 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ceb587969539ca4f08107e7f2c4d4ce154c5f0ace6cc25dc9b316cdf01c43bdc
4
- data.tar.gz: 57c7f8d83303f5a32b7f86101902a52a63c5f9fd142484d8bbe9bebcf84e5d1b
3
+ metadata.gz: 72a624e96a7c740179d82959a81d6eceee7987813a6dbed662a5113eb41e76d2
4
+ data.tar.gz: 07ddbc628d18fa4b3a006a2709858001146f86d94f487368eca2c6e247f03ece
5
5
  SHA512:
6
- metadata.gz: 320b4eb7bc7b2072ddd38d1792964dfbbf76843708beab319d385802467e5932ae55b16ce01636dbc9b6cd8d7cbdf9568468063e973dd5b99e90ff4bf65caf00
7
- data.tar.gz: 309b12058621656173a45359513509701f9e785d52e92ebac95adebd74083fe8c4e6e17bdbe54535a25d7bd656c73315aed7f026e448c06b0103c821f6f86b70
6
+ metadata.gz: '08f7de1d997ace9ecb6e741e95f66be1a14bb1b044683f41d0c27d24ec4b1bd995f0a5e2feb2f20dca07704416e809a5735aa39dc153c7497bbbce650003db4b'
7
+ data.tar.gz: 8fc7ac974e5d03f6982fba484cc3ed2c54b9f5c9e3a38dd7a9ec1241100bb95e055639a75ffe79a9b3fffffbe06f3ab7c4a3ac162b8e63cd4316c7a73af2d7c8
@@ -1,6 +1,7 @@
1
1
  # Changelog
2
2
 
3
- ## [Unreleased]
3
+ ## [4.1.0] - 2019-01-15
4
+ - Upgrade dependencies: `activerecord-import` to >=0.27.1 | @jkowens
4
5
 
5
6
  ## [4.0.0] - 2018-07-19
6
7
  - Adde German translation | @morris-frank
data/README.md CHANGED
@@ -1,31 +1,28 @@
1
1
  # ActiveAdminImport
2
- [The most fastest and efficient CSV import for Active Admin
3
- with support of validations, bulk inserts and encodings handling](http://activeadmin-plugins.github.io/active_admin_import/)
4
2
 
3
+ [![Travis Build ][build_badge]][build_link]
4
+ [![Coverage Status][coveralls_badge]][coveralls_link]
5
+ [![Code Climate ][codeclimate_badge]][codeclimate_link]
6
+ [![Gem Version ][rubygems_badge]][rubygems_link]
7
+ [![License ][license_badge]][license_link]
5
8
 
6
9
 
7
- [![Build Status](https://img.shields.io/travis/activeadmin-plugins/active_admin_import.svg)](https://travis-ci.org/activeadmin-plugins/active_admin_import)
8
- [![Dependency Status](http://img.shields.io/gemnasium/activeadmin-plugins/active_admin_import.svg)](https://gemnasium.com/activeadmin-plugins/active_admin_import)
9
- [![Coverage Status](https://coveralls.io/repos/activeadmin-plugins/active_admin_import/badge.svg)](https://coveralls.io/r/activeadmin-plugins/active_admin_import)
10
- [![Code Climate](https://codeclimate.com/github/activeadmin-plugins/active_admin_import/badges/gpa.svg)](https://codeclimate.com/github/activeadmin-plugins/active_admin_import)
11
- [![Gem Version](http://img.shields.io/gem/v/active_admin_import.svg)](https://rubygems.org/gems/active_admin_import)
12
- [![License](http://img.shields.io/:license-mit-blue.svg)](http://Fivell.mit-license.org)
10
+ The most fastest and efficient CSV import for Active Admin with support of validations, bulk inserts and encodings handling.
13
11
 
12
+ For more about ActiveAdminImport installation and usage, check [Documentation website](http://activeadmin-plugins.github.io/active_admin_import/) and [Wiki pages](https://github.com/activeadmin-plugins/active_admin_import/wiki) for some specific cases and caveats.
14
13
 
15
14
 
16
- #Installation
15
+ ## Installation
17
16
 
18
17
  Add this line to your application's Gemfile:
19
18
 
20
19
  ```ruby
21
- gem "active_admin_import" , '3.0.0'
22
-
20
+ gem "active_admin_import"
23
21
  ```
24
22
  or
25
23
 
26
24
  ```ruby
27
25
  gem "active_admin_import" , github: "activeadmin-plugins/active_admin_import"
28
-
29
26
  ```
30
27
 
31
28
  And then execute:
@@ -33,18 +30,15 @@ And then execute:
33
30
  $ bundle
34
31
 
35
32
 
36
- # active_admin_import features
37
- <ol>
38
- <li> Replacements/Updates support</li>
39
- <li> Encoding handling</li>
40
- <li> CSV options</li>
41
- <li> Ability to describe/change CSV headers</li>
42
- <li> Bulk import (activerecord-import)</li>
43
- <li> Callbacks</li>
44
- <li> Zip files</li>
45
- <li> and more...</li>
46
- </ol>
47
-
33
+ ## Features
34
+ * Replacements/Updates support
35
+ * Encoding handling
36
+ * CSV options
37
+ * Ability to describe/change CSV headers
38
+ * Bulk import (activerecord-import)
39
+ * Callbacks
40
+ * Zip files
41
+ * and more...
48
42
 
49
43
 
50
44
  #### Basic usage
@@ -61,16 +55,17 @@ Tool | Description
61
55
  --------------------- | -----------
62
56
  :back |resource action to redirect after processing
63
57
  :csv_options |hash with column separator, row separator, etc
64
- :validate |bool means perform validations or not
58
+ :validate |bool (true by default), perform validations or not
59
+ :batch_transaction |bool (false by default), if transaction is used when batch importing and works when :validate is set to true
65
60
  :batch_size |integer value of max record count inserted by 1 query/transaction
66
- :batch_transaction |bool (false by default), if transaction is used when batch importing and works when :validate is set to true
67
61
  :before_import |proc for before import action, hook called with importer object
68
62
  :after_import |proc for after import action, hook called with importer object
69
63
  :before_batch_import |proc for before each batch action, called with importer object
70
64
  :after_batch_import |proc for after each batch action, called with importer object
71
- :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.
65
+ :on_duplicate_key_update|an Array or Hash, tells activerecord-import to use MySQL's ON DUPLICATE KEY UPDATE or Postgres 9.5+/SQLite 3.24.0+ ON CONFLICT DO UPDATE ability
66
+ :on_duplicate_key_ignore|bool, tells activerecord-import to use MySQL's INSERT IGNORE or Postgres 9.5+ ON CONFLICT DO NOTHING or SQLite's INSERT OR IGNORE ability
67
+ :ignore |bool, alias for on_duplicate_key_ignore
72
68
  :timestamps |bool, tells activerecord-import to not add timestamps (if false) even if record timestamps is disabled in ActiveRecord::Base
73
- :ignore |bool, tells activerecord-import to use MySQL's INSERT IGNORE ability
74
69
  :template |custom template rendering
75
70
  :template_object |object passing to view
76
71
  :resource_class |resource class name
@@ -96,6 +91,17 @@ Tool | Description
96
91
  [rchardet]: https://github.com/jmhodges/rchardet
97
92
  [activerecord-import]: https://github.com/zdennis/activerecord-import
98
93
 
94
+ [build_badge]: https://travis-ci.org/activeadmin-plugins/active_admin_import.svg?branch=master
95
+ [build_link]: https://travis-ci.org/activeadmin-plugins/active_admin_import
96
+ [coveralls_badge]: https://coveralls.io/repos/activeadmin-plugins/active_admin_import/badge.svg
97
+ [coveralls_link]: https://coveralls.io/github/activeadmin-plugins/active_admin_import
98
+ [codeclimate_badge]: https://codeclimate.com/github/activeadmin-plugins/active_admin_import/badges/gpa.svg
99
+ [codeclimate_link]: https://codeclimate.com/github/activeadmin-plugins/active_admin_import
100
+ [rubygems_badge]: https://badge.fury.io/rb/active_admin_import.svg
101
+ [rubygems_link]: https://rubygems.org/gems/active_admin_import
102
+ [license_badge]: http://img.shields.io/:license-mit-blue.svg
103
+ [license_link]: http://Fivell.mit-license.org
104
+
99
105
 
100
106
  ## Contributing
101
107
 
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
15
15
  gem.name = 'active_admin_import'
16
16
  gem.require_paths = ['lib']
17
17
  gem.version = ActiveAdminImport::VERSION
18
- gem.add_runtime_dependency 'activerecord-import', '~> 0.17.0'
18
+ gem.add_runtime_dependency 'activerecord-import', '~> 0.27'
19
19
  gem.add_runtime_dependency 'rchardet', '~> 1.6'
20
20
  gem.add_runtime_dependency 'rubyzip', '~> 1.2'
21
21
  gem.add_dependency 'activeadmin', '>= 1.0.0.pre2'
@@ -8,6 +8,7 @@ module ActiveAdminImport
8
8
  OPTIONS = [
9
9
  :validate,
10
10
  :on_duplicate_key_update,
11
+ :on_duplicate_key_ignore,
11
12
  :ignore,
12
13
  :timestamps,
13
14
  :before_import,
@@ -48,7 +49,16 @@ module ActiveAdminImport
48
49
  end
49
50
 
50
51
  def import_options
51
- @import_options ||= options.slice(:validate, :on_duplicate_key_update, :ignore, :timestamps, :batch_transaction)
52
+ @import_options ||= options.slice(
53
+ :validate,
54
+ :validate_uniqueness,
55
+ :on_duplicate_key_update,
56
+ :on_duplicate_key_ignore,
57
+ :ignore,
58
+ :timestamps,
59
+ :batch_transaction,
60
+ :batch_size
61
+ )
52
62
  end
53
63
 
54
64
  def batch_replace(header_key, options)
@@ -134,7 +144,10 @@ module ActiveAdminImport
134
144
  end
135
145
 
136
146
  def assign_options(options)
137
- @options = { batch_size: 1000, validate: true }.merge(options.slice(*OPTIONS))
147
+ @options = {
148
+ batch_size: 1000,
149
+ validate_uniqueness: true
150
+ }.merge(options.slice(*OPTIONS))
138
151
  detect_csv_options
139
152
  end
140
153
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module ActiveAdminImport
3
- VERSION = "4.0.0"
4
+ VERSION = '4.1.0'
4
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_admin_import
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Fedoronchuk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-21 00:00:00.000000000 Z
11
+ date: 2019-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord-import
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.17.0
19
+ version: '0.27'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.17.0
26
+ version: '0.27'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rchardet
29
29
  requirement: !ruby/object:Gem::Requirement