protobuf-activerecord 3.3.2 → 3.3.3

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: 1dd165bad09c99c5b394865faaaa00efaffcb3fb
4
- data.tar.gz: 88c7bb55c4408f66397ffb8ca5f4fda21c0e4a64
3
+ metadata.gz: b38ffa80f940e4ac8d5fc3fb2872977bb85db233
4
+ data.tar.gz: 0341aad5a468926b8bca0ac43586ad44f26d8ff7
5
5
  SHA512:
6
- metadata.gz: 5b89216c06f6a28dc2f0af37bacf0e5cad14b104305a545241a867086458d7f6b60610566e22dbd2010c0e91468647bcc2b437cfd63c0fc99229518d5f61826a
7
- data.tar.gz: 5cbdf81b2078d11c22d05d9924dc819ad7bbaf4739efad1dd60a37298544aab140474d2a00aea2e91cfa9af61f63c47b18674f587839f75b49a47439898a1781
6
+ metadata.gz: 0522e4d8d8fafaf3addbc02323b5bfc60266ce647b233c9e3b8450e024d860c4abc2fd8f9cdadc53e52ca466a8ec336306a397dc6c9d180ed85a54ecc81cbbc3
7
+ data.tar.gz: 7a228a59050acdfa65e8862a24893ef08e10330a00f9ad0cd3584de214ac0ead7a1fbbd8dc5a01cdba3a4e9fd5c4f202207a3524281984d9641b313382c09ffc
@@ -24,6 +24,7 @@ module Protobuf
24
24
  # :nodoc:
25
25
  def _protobuf_convert_attributes_to_fields(key, value)
26
26
  return value unless _protobuf_date_datetime_time_or_timestamp_column?(key)
27
+ return nil if value.nil?
27
28
  return value.to_i unless _protobuf_date_column?(key)
28
29
 
29
30
  value.to_time(:utc).to_i
@@ -59,21 +59,18 @@ module Protobuf
59
59
 
60
60
  # :nodoc:
61
61
  def _protobuf_convert_fields_to_attributes(key, value)
62
- return value if value.nil?
62
+ return nil if value.nil?
63
+ return value unless _protobuf_date_datetime_time_or_timestamp_column?(key)
63
64
 
64
65
  value = case
65
- when !_protobuf_date_datetime_time_or_timestamp_column?(key) then
66
- value
67
- when _protobuf_date_column?(key) then
68
- convert_int64_to_date(value)
69
66
  when _protobuf_datetime_column?(key) then
70
67
  convert_int64_to_datetime(value)
71
- when _protobuf_time_column?(key) then
72
- convert_int64_to_time(value)
73
68
  when _protobuf_timestamp_column?(key) then
74
69
  convert_int64_to_time(value)
75
- else
76
- value
70
+ when _protobuf_time_column?(key) then
71
+ convert_int64_to_time(value)
72
+ when _protobuf_date_column?(key) then
73
+ convert_int64_to_date(value)
77
74
  end
78
75
 
79
76
  return value
@@ -1,5 +1,5 @@
1
1
  module Protobuf
2
2
  module ActiveRecord
3
- VERSION = "3.3.2"
3
+ VERSION = "3.3.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protobuf-activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.2
4
+ version: 3.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Hutchison
@@ -234,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
234
234
  version: '0'
235
235
  requirements: []
236
236
  rubyforge_project:
237
- rubygems_version: 2.2.0
237
+ rubygems_version: 2.4.5.1
238
238
  signing_key:
239
239
  specification_version: 4
240
240
  summary: Google Protocol Buffers integration for Active Record