csv_step_importer 0.4.0 → 0.5.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4caae3839b1bd0f1183e3010f5a313882d55b327558089752ed1eb0a4dc6d437
|
4
|
+
data.tar.gz: 719436ba5ed705ef54b824ef2968366877dd2e24ab11aaec50fc89b8f43c048a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 574968999c2b473da6de3d2e48b3170eb6c13ed9ec69265369d77f06b1546ef90d6e8785c02a899b9c9177646160178512c57b905fe7c3033d37c5a4f2f33a51
|
7
|
+
data.tar.gz: f9bde53332d316b0f03daaafa167c2234caf9cf9dc9c9853129f870e2b5028918194172b7b51110fc09db313e998820753a44502948ebcdadff9694a5fd13d33
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
csv_step_importer (0.
|
4
|
+
csv_step_importer (0.5.0)
|
5
5
|
activemodel
|
6
6
|
activerecord-import
|
7
7
|
activesupport
|
@@ -110,8 +110,8 @@ PLATFORMS
|
|
110
110
|
ruby
|
111
111
|
|
112
112
|
DEPENDENCIES
|
113
|
-
csv_step_importer!
|
114
113
|
bundler (~> 1.16)
|
114
|
+
csv_step_importer!
|
115
115
|
rake (~> 10.0)
|
116
116
|
rspec (~> 3.0)
|
117
117
|
rubocop-rails
|
@@ -30,6 +30,11 @@ module CSVStepImporter
|
|
30
30
|
raise "please extend and implement"
|
31
31
|
end
|
32
32
|
|
33
|
+
# see: https://github.com/zdennis/activerecord-import/wiki/On-Duplicate-Key-Update
|
34
|
+
def on_duplicate_key_ignore
|
35
|
+
false
|
36
|
+
end
|
37
|
+
|
33
38
|
# example [:email, :updated_at]
|
34
39
|
# see: https://github.com/zdennis/activerecord-import/wiki/On-Duplicate-Key-Update
|
35
40
|
def on_duplicate_key_update
|
@@ -7,6 +7,7 @@ module CSVStepImporter
|
|
7
7
|
|
8
8
|
delegate :model_class, to: :parent
|
9
9
|
delegate :columns, to: :parent
|
10
|
+
delegate :on_duplicate_key_ignore, to: :parent
|
10
11
|
delegate :on_duplicate_key_update, to: :parent
|
11
12
|
delegate :dao_values, to: :parent
|
12
13
|
|
@@ -14,6 +15,7 @@ module CSVStepImporter
|
|
14
15
|
model_class.import(
|
15
16
|
columns,
|
16
17
|
dao_values,
|
18
|
+
on_duplicate_key_ignore: on_duplicate_key_ignore,
|
17
19
|
on_duplicate_key_update: on_duplicate_key_update,
|
18
20
|
validate: false,
|
19
21
|
timestamps: false,
|