protobuf-activerecord 3.2.0 → 3.2.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 043d45ce686ee0a930ea7aee24fdd56737d3535d
|
4
|
+
data.tar.gz: 145090542220062b92f1708920ab30b901dfa108
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e02a40872c328a7da092e36685511baf307a46d6a0a4e66e5a6f2f621f6fbbc199deaeb00aced709f7fd957866f8e6106acef0f72d7491a829a4920d2adfe14e
|
7
|
+
data.tar.gz: 3159dd77e7b3b3b7ddbc10b9c92d7a73ac6786aa412b0afc83984efc5905b7bf2940e0793f68bf6d62007dd86d10c39187ec0932a306bcfda9cdd014f4bd9107
|
@@ -30,7 +30,7 @@ module Protobuf
|
|
30
30
|
fields = proto.to_hash
|
31
31
|
fields.select! do |key, value|
|
32
32
|
field = proto.class.get_field(key, true)
|
33
|
-
proto.
|
33
|
+
proto.field?(key) && !field.repeated?
|
34
34
|
end
|
35
35
|
|
36
36
|
filtered_attributes = _filtered_attributes + _protobuf_nested_attributes
|
data/spec/support/models/user.rb
CHANGED
@@ -11,7 +11,7 @@ class User < ActiveRecord::Base
|
|
11
11
|
attribute_from_proto :password, lambda { |proto| proto.password! }
|
12
12
|
|
13
13
|
def self.extract_first_name(proto)
|
14
|
-
if proto.
|
14
|
+
if proto.field?(:name)
|
15
15
|
names = proto.name.split(" ")
|
16
16
|
first_name = names.first
|
17
17
|
end
|
@@ -20,7 +20,7 @@ class User < ActiveRecord::Base
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def self.extract_last_name(proto)
|
23
|
-
if proto.
|
23
|
+
if proto.field?(:name)
|
24
24
|
names = proto.name.split(" ")
|
25
25
|
names.shift # Drop the first name
|
26
26
|
last_name = names.join(" ")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: protobuf-activerecord
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Hutchison
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|