activerecord-bixformer 0.4.13 → 0.4.14
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ece796f327a3cf4bcf833c066b98121ef08a02a3
|
4
|
+
data.tar.gz: a48f51c405fed75321430c14b0a75f16f3c7ee52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34db4f8782098149e84d145ed0ae9d496cfe0753d2771aa1e5cc7337d268e0848aba6558bd56c1deb0c442c559e6497f72deafa4436a2e6208c0f7cddad7af4b
|
7
|
+
data.tar.gz: 7aa3470ff539d7c68fd5e5a6cd25c75f323809b69c51e13a4ab92dd4b0ce0a96331394cab3b9e7d4c78b7634685dfb6a04b1d396d8113db4bc809656ee6b80a9
|
@@ -145,8 +145,8 @@ module ActiveRecord
|
|
145
145
|
|
146
146
|
private
|
147
147
|
|
148
|
-
def make_each_attribute_import_value(parent_record_id = nil, &block)
|
149
|
-
values =
|
148
|
+
def make_each_attribute_import_value(parent_record_id = nil, initializer: {}, &block)
|
149
|
+
values = initializer.with_indifferent_access
|
150
150
|
normalizer = ::ActiveRecord::Bixformer::AssignableAttributesNormalizer.new(plan, self, parent_record_id)
|
151
151
|
|
152
152
|
run_bixformer_callback :import, type: :attribute do
|
@@ -68,8 +68,8 @@ module ActiveRecord
|
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
|
-
def do_import(csv_body_row, parent_record_id = nil)
|
72
|
-
values = make_each_attribute_import_value(parent_record_id) do |attr|
|
71
|
+
def do_import(csv_body_row, parent_record_id = nil, initializer: {})
|
72
|
+
values = make_each_attribute_import_value(parent_record_id, initializer: initializer) do |attr|
|
73
73
|
attr.import(csv_body_row[csv_title(attr.name)])
|
74
74
|
end
|
75
75
|
|
@@ -33,9 +33,7 @@ module ActiveRecord
|
|
33
33
|
@options[:in].map do |key|
|
34
34
|
update_translator(key)
|
35
35
|
|
36
|
-
do_import(csv_body_row, parent_record_id
|
37
|
-
o[@options[:key]] = key if presence_value?(o)
|
38
|
-
end
|
36
|
+
do_import(csv_body_row, parent_record_id, initializer: { @options[:key] => key })
|
39
37
|
end
|
40
38
|
end
|
41
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-bixformer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hiroaki Otsu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|