multiparameter_date_time 0.3.0 → 0.3.1
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: 6d4d26459078d4e3b45ad66c83b799f3f0952f6e
|
4
|
+
data.tar.gz: 218fdd168c545012600f3382ec2f8dfc1334f004
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a18572f6677a4602741d3083ad9109e757b70480c5f9fd629545aae318d20782e48474367bc114db4b9fcd6a14084cf945699e70e56997271d89601f86b4da1c
|
7
|
+
data.tar.gz: 1db08473c64d47dbefefba1a3372c26c55fdd365ab7896cb1db479285291b29090165821efa6742362f6de44db9291c71192118b743df94ee53c49f01c14fbc0
|
@@ -52,7 +52,7 @@ module MultiparameterDateTime
|
|
52
52
|
else
|
53
53
|
date_part, time_part = date_time_input.split(' ', 2)
|
54
54
|
parsed_date_part = begin
|
55
|
-
Date.parse(date_part)
|
55
|
+
date_part && Date.parse(date_part)
|
56
56
|
rescue ArgumentError
|
57
57
|
nil
|
58
58
|
end
|
@@ -65,6 +65,8 @@ module MultiparameterDateTime
|
|
65
65
|
public_send(time_part_setter, time_part)
|
66
66
|
end
|
67
67
|
end
|
68
|
+
else
|
69
|
+
super date_time_input
|
68
70
|
end
|
69
71
|
end
|
70
72
|
|
@@ -342,6 +342,15 @@ describe MultiparameterDateTime do
|
|
342
342
|
end
|
343
343
|
end
|
344
344
|
|
345
|
+
describe "setting to nil" do
|
346
|
+
it "is nil" do
|
347
|
+
record = ModelWithDateTime.new
|
348
|
+
record.foo = Time.current
|
349
|
+
record.foo = nil
|
350
|
+
expect(record.foo).to eq nil
|
351
|
+
end
|
352
|
+
end
|
353
|
+
|
345
354
|
describe "configuring the datetime format" do
|
346
355
|
let(:record) { model.new(foo: Time.zone.parse('01/09/2000 1:30 pm')) }
|
347
356
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: multiparameter_date_time
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Case Commons, LLC
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2014-07-
|
14
|
+
date: 2014-07-09 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: american_date
|