om 3.0.5 → 3.0.6

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: 1de731732be29cdf0c460beebcb5b603deccb18c
4
- data.tar.gz: 6fa913f9d7bcdd57e7d29555a266d265dd426ad0
3
+ metadata.gz: d22a3f6b7dc5a7d6c75dac4d1bf14c60f5e0fc0c
4
+ data.tar.gz: 22198afe29d16339742f4ef4a9735121afa31136
5
5
  SHA512:
6
- metadata.gz: e947f9c90119f8ac601105505d947a2ad78d4307ada79f3f7e609fd64ecb71c0330bbe668438e1d4ee71aac4dbcf112a9f5d2a0fe4a841d9a22125b81cd78e9d
7
- data.tar.gz: 4db6a2f387c9630f6e9909966bc81e9939110ac92b6588745fb82766ec23d3249041ddbe70b5ddba6322b094622e51cdd09da26365bec6c6af7fcb12cc2a9f5a
6
+ metadata.gz: a32c99b5587ae306791119c7e4e0c0b9e6d7ae7f8bb36e9ad4102c6de90c6a892daebc680083ab2609e9bf261f608f0d15d67dd66f30ec5263fc143d376f71b5
7
+ data.tar.gz: 4a4cb65a378cbef9ce02f38f05309916c6703978962112a01d7a08ff51ccad389f5efd78425b43531fada607b1cb25888f04f652e568f4e020f1e006e4999886
@@ -1,3 +1,3 @@
1
1
  module Om
2
- VERSION = "3.0.5"
2
+ VERSION = "3.0.6"
3
3
  end
@@ -94,7 +94,12 @@ module OM
94
94
  when :date, :integer
95
95
  val.to_s
96
96
  when :time
97
- time = val.to_time
97
+ begin
98
+ time = val.to_time
99
+ rescue ArgumentError
100
+ # In Rails 3, an invalid time raises ArgumentError, in Rails 4 it just returns nil
101
+ raise TypeMismatch, "Can't convert `#{val}` to time"
102
+ end
98
103
  raise TypeMismatch, "Can't convert `#{val}` to time" if time.nil?
99
104
  time.utc.iso8601
100
105
  when :boolean
@@ -1,5 +1,6 @@
1
1
  require 'spec_helper'
2
2
  require 'active_support/core_ext/string/conversions' # for String#to_time conversion
3
+ require 'active_support/core_ext/date_time/conversions' # for String#to_time conversion (only needed for Rails 3)
3
4
 
4
5
  describe "element values" do
5
6
  before(:all) do
@@ -64,6 +65,9 @@ EOF
64
65
  it "raises a type mismatch error" do
65
66
  expect { datastream.my_time = '' }.to raise_error OM::TypeMismatch
66
67
  end
68
+ it "raises a type mismatch error" do
69
+ expect { datastream.my_time = 'Foo' }.to raise_error OM::TypeMismatch
70
+ end
67
71
  end
68
72
  end
69
73
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: om
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.5
4
+ version: 3.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Zumwalt