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 +4 -4
- data/lib/protobuf/active_record/serialization.rb +14 -6
- data/lib/protobuf/active_record/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87dec3e169a7e7dde6b3cf41a7cc43b1ac998e32
|
4
|
+
data.tar.gz: 6114fc45587dd9cff5df2846f6fc4088d91df5c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
205
|
-
self.
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
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}
|