field_mapper 0.2.7 → 0.2.8
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f009a40a9613eefe1d0a04b110b1e4672c6a79d
|
4
|
+
data.tar.gz: d605c6c72f1ccbbec89ca99f0e786d0aa2db5a06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41a60a34ab9b8002a71b13bdcde0053d8cc57da9ed5a833e54638b2ffd3b3ce36de1374ed4d65601ca4665f0a45e8fe6b06c0ae95c9f5d8ebe8ec83f287727f2
|
7
|
+
data.tar.gz: 1dbec77a8049c31b2551ecbba1b2745cdb0a5ca3d2fd2104cc702b50ed006f37b141d20295649ca0279d5c490b5f6538a27ae55f5a549a7d9b46ffe106648f27
|
@@ -44,7 +44,10 @@ module FieldMapper
|
|
44
44
|
protected
|
45
45
|
|
46
46
|
def get_raw_standard_value(custom_field, raw_custom_value, standard_instance)
|
47
|
-
|
47
|
+
if raw_custom_value.nil?
|
48
|
+
return [] if custom_field.standard_field.list_with_emtpy_default?
|
49
|
+
return nil
|
50
|
+
end
|
48
51
|
|
49
52
|
strategy = custom_field.flip_strategy(:custom_to_standard)
|
50
53
|
custom_flipper = custom_field.custom_flipper?(:custom_to_standard)
|
@@ -62,7 +65,7 @@ module FieldMapper
|
|
62
65
|
end
|
63
66
|
|
64
67
|
if strategy == :find
|
65
|
-
if custom_field.
|
68
|
+
if custom_field.list?
|
66
69
|
return raw_custom_value.map do |single_raw_custom_value|
|
67
70
|
find_raw_standard_value(custom_field, single_raw_custom_value)
|
68
71
|
end
|
@@ -37,7 +37,10 @@ module FieldMapper
|
|
37
37
|
protected
|
38
38
|
|
39
39
|
def get_raw_custom_value(custom_field, raw_standard_value, custom_instance)
|
40
|
-
|
40
|
+
if raw_standard_value.nil?
|
41
|
+
return [] if custom_field.list_with_emtpy_default?
|
42
|
+
return nil
|
43
|
+
end
|
41
44
|
|
42
45
|
strategy = custom_field.flip_strategy(:standard_to_custom)
|
43
46
|
custom_flipper = custom_field.custom_flipper?(:standard_to_custom)
|
@@ -55,7 +58,7 @@ module FieldMapper
|
|
55
58
|
end
|
56
59
|
|
57
60
|
if strategy == :find
|
58
|
-
if custom_field.
|
61
|
+
if custom_field.list?
|
59
62
|
return raw_standard_value.map do |single_raw_standard_value|
|
60
63
|
find_raw_custom_value(custom_field, single_raw_standard_value)
|
61
64
|
end
|
data/lib/field_mapper/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: field_mapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Hopkins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|