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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 01f84c56da660d2e5dbfd6d193d56e87c417a74c
4
- data.tar.gz: 6ab4605c0f0f88a822aa8f5d80fe51464481a5da
3
+ metadata.gz: 7a9c8872591d7142bc009baff435e8e1414e7ec6
4
+ data.tar.gz: 3474ec2803122093e8eb273c6b45581cd06ff47f
5
5
  SHA512:
6
- metadata.gz: 104980bb3864d370dc374322f498387c0e4c29807e8d2ac09ef8c7bfe69a60bf701ab45ebc5f95928bc8bc2e4b1732e72be3e584ba54979a0da81cc71b989930
7
- data.tar.gz: a1dbc0caae55b5238ad9afec40d16978e0090753b259c39d70573179dd9b5c3d2a32d2825737d61bb0e17a74d718c2373ca127a261e9c22818c49669e8f56658
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
 
@@ -1,3 +1,3 @@
1
1
  module FieldMapper
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.4"
3
3
  end
@@ -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.1
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-05-31 00:00:00.000000000 Z
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.0.10
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.0.10
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.11
199
+ rubygems_version: 2.6.13
200
200
  signing_key:
201
201
  specification_version: 4
202
202
  summary: Data mapping & transformation