field_mapper 0.4.1 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/field_mapper/standard/field.rb +1 -1
- data/lib/field_mapper/version.rb +1 -1
- data/test/standard/field_test.rb +5 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a9c8872591d7142bc009baff435e8e1414e7ec6
|
4
|
+
data.tar.gz: 3474ec2803122093e8eb273c6b45581cd06ff47f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b78dd13a45c0162b099680402af6c0579a78aaed9667a823398eb54e653754716aa6bff2cc8ce65ddd5386b53edd4384b1444c79e4447cff48b58a02d15f11b1
|
7
|
+
data.tar.gz: 077ec19016b8f3ed2d0d34fc0842f03e7378a24c46b8f28ea34c6927496b772d241751a54c42b3f9f15187229a9386e7f5385b11f8d68ea7755652bda68652ed
|
@@ -157,7 +157,7 @@ module FieldMapper
|
|
157
157
|
def time(value)
|
158
158
|
return value.utc if value.is_a?(Time)
|
159
159
|
return value.to_time.utc if value.is_a?(Date)
|
160
|
-
return value.to_time(:utc) if value.is_a?(String)
|
160
|
+
return value.to_time(:utc) rescue nil if value.is_a?(String)
|
161
161
|
nil
|
162
162
|
end
|
163
163
|
|
data/lib/field_mapper/version.rb
CHANGED
data/test/standard/field_test.rb
CHANGED
@@ -152,5 +152,10 @@ module Standard
|
|
152
152
|
field = FieldMapper::Standard::Field.new(:foo, type: String)
|
153
153
|
assert field.to_s == field.name
|
154
154
|
end
|
155
|
+
|
156
|
+
test 'stupid date string returns nil' do
|
157
|
+
field = FieldMapper::Standard::Field.new(:foo, type: Time)
|
158
|
+
assert field.cast('2032-Aug-32').nil?
|
159
|
+
end
|
155
160
|
end
|
156
161
|
end
|
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.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Hopkins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 3.
|
75
|
+
version: 3.3.5
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 3.
|
82
|
+
version: 3.3.5
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: bundler
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -196,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
196
196
|
version: '0'
|
197
197
|
requirements: []
|
198
198
|
rubyforge_project:
|
199
|
-
rubygems_version: 2.6.
|
199
|
+
rubygems_version: 2.6.13
|
200
200
|
signing_key:
|
201
201
|
specification_version: 4
|
202
202
|
summary: Data mapping & transformation
|