protobuf-activerecord 3.3.6 → 3.3.7

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: 1edb2561d3b5957204fec48bb4ea3fa0d1a20a8c
4
- data.tar.gz: da45242b3494982173f4058fb28950d9054c2289
3
+ metadata.gz: 87dec3e169a7e7dde6b3cf41a7cc43b1ac998e32
4
+ data.tar.gz: 6114fc45587dd9cff5df2846f6fc4088d91df5c3
5
5
  SHA512:
6
- metadata.gz: 3ad12a5f32846341399c3ba0d2f74f5aed05949864dcf0c90945382c827db6345a7ebfe399f6ef7bf1038ec556f7693fbbe2c350d54f488c14372115d5436ed0
7
- data.tar.gz: 8003d794964acdd6c174e6b632e6d42f2d58d2886581f0ad18c7c8e15a33ff0bbb8db2a310a908485cebb80694ee7dcbe0cbeb185019a17d99233d63078b15ad
6
+ metadata.gz: 33e86a724438fbc8273bd079fa181303cf91a8aa5af3a9c0c5d71a1c9b8fa3b17b61c572830b0e6091688e52dbaf33148803da6195e9b6d673960334db05eb4e
7
+ data.tar.gz: 44170e624e1155802f448e310d7c5321f8add437da893d61e27329ef964b5a41c9f08ea66ff27771dfe92b5352fd1fda20a41232e35c7d86dbd76831f4dffcd4
@@ -201,12 +201,20 @@ module Protobuf
201
201
  def _protobuf_write_symbol_transformer_method(field)
202
202
  transformer_method = _protobuf_field_symbol_transformers[field]
203
203
 
204
- if self.methods.include?(transformer_method)
205
- self.class_eval <<-RUBY, __FILE__, __LINE__ + 1
206
- def _protobuf_active_record_serialize_#{field}
207
- self.class.#{transformer_method}(self)
208
- end
209
- RUBY
204
+ if self.respond_to?(transformer_method, true)
205
+ if self.respond_to?(transformer_method, false)
206
+ self.class_eval <<-RUBY, __FILE__, __LINE__ + 1
207
+ def _protobuf_active_record_serialize_#{field}
208
+ self.class.#{transformer_method}(self)
209
+ end
210
+ RUBY
211
+ else
212
+ self.class_eval <<-RUBY, __FILE__, __LINE__ + 1
213
+ def _protobuf_active_record_serialize_#{field}
214
+ self.class.__send__(#{transformer_method}, self)
215
+ end
216
+ RUBY
217
+ end
210
218
  else
211
219
  self.class_eval <<-RUBY, __FILE__, __LINE__ + 1
212
220
  def _protobuf_active_record_serialize_#{field}
@@ -1,5 +1,5 @@
1
1
  module Protobuf
2
2
  module ActiveRecord
3
- VERSION = "3.3.6"
3
+ VERSION = "3.3.7"
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.6
4
+ version: 3.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Hutchison