csv_step_importer 0.7.2 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 010566e1eef5979197228e21e4b1767c46b4a01dac5b2c5b2a5ab0ced475728a
|
4
|
+
data.tar.gz: a471e746cef84c4466b064d73da3d8528d68a285cd579b3f5a51ed9ba81a1ffb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e85c978b53a36fc142780d740b20929a5352ab9c76c537e6ce323893425192da56d5ace7c1b01fea93ea5388f0daa160955d2d2b1908afc752273b512e0f7ef3
|
7
|
+
data.tar.gz: ca0dc39aed81533c2de6323e7b112f83783845846a83eb346db641b8ed65adc76ce9b53bb0ba846638ffcca8c88a41e67f490e91587c4a15c868a3746f5754c3
|
@@ -22,7 +22,21 @@ module CSVStepImporter
|
|
22
22
|
|
23
23
|
def value
|
24
24
|
@value ||= columns.each_with_object({}) do |key, values|
|
25
|
-
values[key] =
|
25
|
+
values[key] = value_for_key key
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def value_for_key key
|
30
|
+
if respond_to?(key)
|
31
|
+
send key
|
32
|
+
elsif attributes.include? key
|
33
|
+
attributes[key]
|
34
|
+
elsif row.respond_to?(key)
|
35
|
+
row.send key
|
36
|
+
elsif row.attributes.include? key
|
37
|
+
row.attributes[key]
|
38
|
+
else
|
39
|
+
nil
|
26
40
|
end
|
27
41
|
end
|
28
42
|
|
@@ -12,10 +12,12 @@ module CSVStepImporter
|
|
12
12
|
raise "please extend and implement"
|
13
13
|
end
|
14
14
|
|
15
|
+
# set to nil in order to deactivate
|
15
16
|
def importer_class
|
16
17
|
CSVStepImporter::Model::Importer
|
17
18
|
end
|
18
19
|
|
20
|
+
# set to nil in order to deactivate
|
19
21
|
def reflector_class
|
20
22
|
CSVStepImporter::Model::Reflector
|
21
23
|
end
|