active_admin_import 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -9,7 +9,6 @@ https://github.com/gregbell/active_admin
9
9
  https://github.com/zdennis/activerecord-import
10
10
 
11
11
 
12
-
13
12
  #Options
14
13
 
15
14
  # +back+:: resource action to redirect after processing
@@ -20,15 +19,30 @@ https://github.com/zdennis/activerecord-import
20
19
  # +after_import+:: proc for after import action, hook called with importer object
21
20
  # +before_batch_import+:: proc for before each batch action, called with importer object
22
21
  # +after_batch_import+:: proc for after each batch action, called with importer object
22
+ # +fetch_extra_options_from_params+:: params available in callbacks ( importer.extra_options proprty hash )
23
23
  # +on_duplicate_key_update+:: an Array or Hash, tells activerecord-import to use MySQL's ON DUPLICATE KEY UPDATE ability.
24
24
  # +timestamps+:: true|false, tells activerecord-import to not add timestamps (if false) even if record timestamps is disabled in ActiveRecord::Base
25
25
  # +ignore+:: true|false, tells activerecord-import toto use MySQL's INSERT IGNORE ability
26
26
  # +params_keys+:: params values available in callbacks
27
27
  # +template+:: custom template rendering
28
+ # +template_object+:: object passing to view
28
29
  # +locals+:: local variables for template
29
30
  # +resource_class+:: resource class name
30
31
  # +resource_label+:: resource label value
32
+ # +headers_rewrites+:: hash with key (csv header) - value (db column name) rows mapping
33
+
34
+
31
35
 
36
+ Default options values
37
+
38
+ :back => :import,
39
+ :col_sep => ',',
40
+ :template => "admin/import",
41
+ :template_object => ActiveAdminImport::Model.new,
42
+ :fetch_extra_options_from_params => [],
43
+ :resource_class => nil,
44
+ :resource_label => nil,
45
+
32
46
 
33
47
  #Example
34
48
 
@@ -44,3 +58,6 @@ https://github.com/zdennis/activerecord-import
44
58
 
45
59
 
46
60
 
61
+ #Source Doc
62
+ http://rubydoc.info/gems/active_admin_import/2.0.0/
63
+
@@ -18,7 +18,7 @@ module ActiveAdminImport
18
18
  # +ignore+:: true|false, tells activerecord-import toto use MySQL's INSERT IGNORE ability
19
19
  # +fetch_extra_options_from_params+:: params values available in callbacks in importer.extra_options hash
20
20
  # +template+:: custom template rendering
21
- # +locals+:: local variables for template
21
+ # +template_object+:: object passing to view
22
22
  # +resource_class+:: resource class name
23
23
  # +resource_label+:: resource label value
24
24
  #
@@ -55,6 +55,7 @@ module ActiveAdminImport
55
55
  lines = []
56
56
  batch_size = options[:batch_size].to_i
57
57
  IO.foreach(file.path) do |line|
58
+ next if line.blank?
58
59
  if headers.empty?
59
60
  prepare_headers(CSV.parse(line, @csv_options).first)
60
61
  else
@@ -1,3 +1,3 @@
1
1
  module ActiveAdminImport
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_admin_import
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-20 00:00:00.000000000 Z
12
+ date: 2013-09-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord-import
16
- requirement: &70124414344240 !ruby/object:Gem::Requirement
16
+ requirement: &70227838555100 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - =
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 0.3.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70124414344240
24
+ version_requirements: *70227838555100
25
25
  description: The most efficient way to import for Active Admin
26
26
  email:
27
27
  - fedoronchuk@gmail.com