tod 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/tod/time_of_day.rb +1 -5
- data/lib/tod/version.rb +1 -1
- data/test/tod/time_of_day_serializable_attribute_test.rb +6 -4
- metadata +3 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95ba589cb9d03ce67ad336aa64c8484a78c3d672
|
4
|
+
data.tar.gz: 193bf73e7b5a5382d5e71a40822e3d22663f8325
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2319de23fd179e408185c1fc0ac6aa9452090b87166f2bd590fd9611a6880f8257cad3eb0b7f3f0d1f789d6861ec99bd6eeaa3484e757823549e65c5e7a3bb9a
|
7
|
+
data.tar.gz: 53df47600a0139bd3f30a3dd6931385b7850283d875c7988a90784b300b54a568e1e75f466d9dd21af309872ea347c01567dfb2e3c116f8208e53e1f353ed12b
|
data/Gemfile.lock
CHANGED
data/lib/tod/time_of_day.rb
CHANGED
@@ -166,11 +166,7 @@ module Tod
|
|
166
166
|
end
|
167
167
|
|
168
168
|
def self.load(time)
|
169
|
-
if time.
|
170
|
-
time.to_time_of_day
|
171
|
-
else
|
172
|
-
TimeOfDay.parse(time) if time && !time.empty?
|
173
|
-
end
|
169
|
+
::Tod::TimeOfDay(time) if time && !time.to_s.empty?
|
174
170
|
end
|
175
171
|
end
|
176
172
|
end
|
data/lib/tod/version.rb
CHANGED
@@ -8,23 +8,25 @@ end
|
|
8
8
|
describe "TimeOfDay with ActiveRecord Serializable Attribute" do
|
9
9
|
describe ".dump" do
|
10
10
|
it "sets time of day" do
|
11
|
-
Order.create(time: Tod::TimeOfDay.new(9, 30))
|
11
|
+
Order.create!(time: Tod::TimeOfDay.new(9, 30))
|
12
12
|
end
|
13
13
|
|
14
14
|
it "sets nil as value" do
|
15
|
-
Order.create(time: nil)
|
15
|
+
Order.create!(time: nil)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
19
|
describe ".load" do
|
20
20
|
it "loads set time" do
|
21
21
|
time_of_day = Tod::TimeOfDay.new(9, 30)
|
22
|
-
order = Order.create(time: time_of_day)
|
22
|
+
order = Order.create!(time: time_of_day)
|
23
|
+
order.reload
|
23
24
|
assert_equal order.time, time_of_day
|
24
25
|
end
|
25
26
|
|
26
27
|
it "returns nil if time is not set" do
|
27
|
-
order = Order.create(time: nil)
|
28
|
+
order = Order.create!(time: nil)
|
29
|
+
order.reload
|
28
30
|
assert_equal order.time, nil
|
29
31
|
end
|
30
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tod
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jack Christensen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -157,13 +157,4 @@ rubygems_version: 2.4.5
|
|
157
157
|
signing_key:
|
158
158
|
specification_version: 4
|
159
159
|
summary: Supplies TimeOfDay and Shift class
|
160
|
-
test_files:
|
161
|
-
- test/support/active_record.rb
|
162
|
-
- test/test_helper.rb
|
163
|
-
- test/tod/conversion_test.rb
|
164
|
-
- test/tod/date_test.rb
|
165
|
-
- test/tod/shift_test.rb
|
166
|
-
- test/tod/time_of_day_serializable_attribute_test.rb
|
167
|
-
- test/tod/time_of_day_test.rb
|
168
|
-
- test/tod/time_of_day_time_zone_with_active_support_test.rb
|
169
|
-
- test/tod/time_test.rb
|
160
|
+
test_files: []
|