protobuf-activerecord 3.1.0 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +1 -1
- data/lib/protobuf/active_record/columns.rb +12 -10
- data/lib/protobuf/active_record/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 976fc954c82761944381e6445e9b603cf2a38e4e
|
4
|
+
data.tar.gz: b5a1ae6b0afb8cc61075460b8ad24c2ee2fc0cb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d8219bf86dafaa0c0046811b2d729b079175213320ba376f5aae07efae283312097019ce5492119b0c50e83cdcce0bc0f66b43a068e94bc472f860619a818e8
|
7
|
+
data.tar.gz: 6dc72951231be8f28e1f520f996896ee6e6677a4b3f008c33c893509ec5c8e91a8da53a0d831bcec7b6a4d3e28aab56e08e1f8c88157bdbbff0db33f385bb5be
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -113,7 +113,7 @@ This does pretty much the same thing, but from a different perspective.
|
|
113
113
|
|
114
114
|
```Ruby
|
115
115
|
user.to_proto(:only => :email) # Only the email
|
116
|
-
user.to_proto(:except => :email) #
|
116
|
+
user.to_proto(:except => :email) # Everything except the email
|
117
117
|
user.to_proto(:include => :email) # Start with the class-level settings, but add email
|
118
118
|
```
|
119
119
|
|
@@ -39,20 +39,22 @@ module Protobuf
|
|
39
39
|
# Map out the columns for future reference on type conversion
|
40
40
|
# :nodoc:
|
41
41
|
def _protobuf_map_columns(force = false)
|
42
|
-
|
42
|
+
::Thread.exclusive do
|
43
|
+
@_protobuf_mapped_columns = false if force
|
43
44
|
|
44
|
-
|
45
|
-
|
45
|
+
return unless table_exists?
|
46
|
+
return if _protobuf_mapped_columns?
|
46
47
|
|
47
|
-
|
48
|
-
|
48
|
+
@_protobuf_columns = {}
|
49
|
+
@_protobuf_column_types = Hash.new { |h,k| h[k] = [] }
|
49
50
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
51
|
+
columns.map do |column|
|
52
|
+
@_protobuf_columns[column.name.to_sym] = column
|
53
|
+
@_protobuf_column_types[column.type.to_sym] << column.name.to_sym
|
54
|
+
end
|
54
55
|
|
55
|
-
|
56
|
+
@_protobuf_mapped_columns = true
|
57
|
+
end
|
56
58
|
end
|
57
59
|
|
58
60
|
def _protobuf_mapped_columns?
|
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.1.
|
4
|
+
version: 3.1.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:
|
11
|
+
date: 2015-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -231,7 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
231
231
|
version: '0'
|
232
232
|
requirements: []
|
233
233
|
rubyforge_project:
|
234
|
-
rubygems_version: 2.
|
234
|
+
rubygems_version: 2.4.5
|
235
235
|
signing_key:
|
236
236
|
specification_version: 4
|
237
237
|
summary: Google Protocol Buffers integration for Active Record
|