You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+62-53Lines changed: 62 additions & 53 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,53 +25,63 @@ And then execute:
25
25
26
26
27
27
28
-
Why yet another import for ActiveAdmin ? Now with activerecord-import ....
28
+
#Why yet another import for ActiveAdmin ? Now with activerecord-import ....
29
29
30
-
"Because plain-vanilla, out-of-the-box ActiveRecord doesn’t provide support for inserting large amounts of data efficiently"
30
+
<p>Because plain-vanilla, out-of-the-box ActiveRecord doesn’t provide support for inserting large amounts of data efficiently</p>
31
31
32
-
cool features of activerecord-import
32
+
Features of activerecord-import
33
33
34
-
activerecord-import can perform validations (fast)
35
-
activerecord-import can perform on duplicate key updates (requires mysql)
36
-
37
-
38
-
So active_admin_import features
39
-
40
-
Encoding handling
41
-
Two step importing (see example2)
42
-
CSV options
43
-
Ability to prepend CSV headers automatically
44
-
Bulk import (activerecord-import)
45
-
Ability to customize template
46
-
Callbacks support
47
-
Zip files import
48
-
and more ....
49
-
50
-
Options
51
-
52
-
# +back+:: resource action to redirect after processing
53
-
# +csv_options+:: hash with column separator, row separator, etc
54
-
# +validate+:: true|false, means perform validations or not
55
-
# +batch_size+:: integer value of max record count inserted by 1 query/transaction
56
-
# +before_import+:: proc for before import action, hook called with importer object
57
-
# +after_import+:: proc for after import action, hook called with importer object
58
-
# +before_batch_import+:: proc for before each batch action, called with importer object
59
-
# +after_batch_import+:: proc for after each batch action, called with importer object
60
-
# +on_duplicate_key_update+:: an Array or Hash, tells activerecord-import to use MySQL's ON DUPLICATE KEY UPDATE ability.
61
-
# +timestamps+:: true|false, tells activerecord-import to not add timestamps (if false) even if record timestamps is disabled in ActiveRecord::Base
62
-
# +ignore+:: true|false, tells activerecord-import toto use MySQL's INSERT IGNORE ability
63
-
# +params_keys+:: params values available in callbacks
64
-
# +template+:: custom template rendering
65
-
# +template_object+:: object passing to view
66
-
# +locals+:: local variables for template
67
-
# +resource_class+:: resource class name
68
-
# +resource_label+:: resource label value
69
-
# +plural_resource_label+:: pluralized resource label value (default config.plural_resource_label)
70
-
# +headers_rewrites+:: hash with key (csv header) - value (db column name) rows mapping
34
+
<ol>
35
+
<li>activerecord-import can perform validations (fast)</li>
36
+
<li>activerecord-import can perform on duplicate key updates (requires mysql)</li>
37
+
</ol>
71
38
39
+
40
+
72
41
73
42
74
-
Default options values
43
+
# active_admin_import features
44
+
<ol>
45
+
<li>Encoding handling</li>
46
+
<li>Preview before importing (Example 2)</li>
47
+
<li> CSV options</li>
48
+
<li> Ability to prepend CSV headers automatically</li>
49
+
<li>Bulk import (activerecord-import)</li>
50
+
<li>Callbacks</li>
51
+
<li>Zip files</li>
52
+
<li>more...</li>
53
+
</ol>
54
+
55
+
56
+
57
+
58
+
#### Options
59
+
60
+
<table>
61
+
<tr><td>name</td><td>description</td></tr>
62
+
<tr><td>:back</td><td>resource action to redirect after processing</td></tr>
63
+
<tr><td>:csv_options</td><td>hash with column separator, row separator, etc </td></tr>
64
+
<tr><td>:validate</td><td>true|false, means perform validations or not</td></tr>
65
+
<tr><td>:batch_size</td><td>integer value of max record count inserted by 1 query/transaction</td></tr>
66
+
<tr><td>:before_import</td><td>proc for before import action, hook called with importer object</td></tr>
67
+
<tr><td>:after_import</td><td>proc for after import action, hook called with importer object</td></tr>
68
+
<tr><td>:before_batch_import</td><td>proc for before each batch action, called with importer object</td></tr>
69
+
<tr><td>:after_batch_import</td><td>proc for after each batch action, called with importer object</td></tr>
70
+
<tr><td>:on_duplicate_key_update</td><td>an Array or Hash, tells activerecord-import to use MySQL's ON DUPLICATE KEY UPDATE ability.</td></tr>
71
+
<tr><td>:timestamps</td><td>true|false, tells activerecord-import to not add timestamps (if false) even if record timestamps is disabled in ActiveRecord::Base</td></tr>
72
+
<tr><td>:ignore</td><td>true|false, tells activerecord-import toto use MySQL's INSERT IGNORE ability</td></tr>
0 commit comments