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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0e1df7c0f812d7e18d6d9b10c256f2e26e63268c
4
- data.tar.gz: f01a512e048fa9087ab1b89376a2f6a49574357f
3
+ metadata.gz: 95ba589cb9d03ce67ad336aa64c8484a78c3d672
4
+ data.tar.gz: 193bf73e7b5a5382d5e71a40822e3d22663f8325
5
5
  SHA512:
6
- metadata.gz: cf81e8e52153b7e894d0a970a88c6da2fe94dbabf984cd289be160b7ab1eb43ce78e6c991c0f833ac25ebc818a7950deae44d19610a1f66081ba1998dae3bbd3
7
- data.tar.gz: d6665499e05b78076fab42c5dfe4b67c94750ad71fc722384f51b7c97aad9b6fc78fc3b2e9906d3af273f66c769bdd73bce956cb206f7a4b63209cd8237d43d0
6
+ metadata.gz: 2319de23fd179e408185c1fc0ac6aa9452090b87166f2bd590fd9611a6880f8257cad3eb0b7f3f0d1f789d6861ec99bd6eeaa3484e757823549e65c5e7a3bb9a
7
+ data.tar.gz: 53df47600a0139bd3f30a3dd6931385b7850283d875c7988a90784b300b54a568e1e75f466d9dd21af309872ea347c01567dfb2e3c116f8208e53e1f353ed12b
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tod (2.0.0)
4
+ tod (2.0.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -166,11 +166,7 @@ module Tod
166
166
  end
167
167
 
168
168
  def self.load(time)
169
- if time.respond_to?(:to_time_of_day)
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
@@ -1,3 +1,3 @@
1
1
  module Tod
2
- VERSION = "2.0.1"
2
+ VERSION = "2.0.2"
3
3
  end
@@ -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.1
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-08 00:00:00.000000000 Z
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: []