protobuf-activerecord 3.0.0.rc2 → 3.0.0.rc3

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: f05a18edbd1975b9bfa100ca10a9cba378f9bb0c
4
- data.tar.gz: 8b5e67786002299711c1166c4138df5b7361f3fc
3
+ metadata.gz: 4138119bd9c5f0638a76a08f3a796ceda7f94163
4
+ data.tar.gz: 1659d777be06f6318e7a2a4b3ccf61ca8b1eeb52
5
5
  SHA512:
6
- metadata.gz: 020fe794814c24474431013da37691656fdfcf9d6de94daf40fd060c4c7fbdad53678b22dc1d79d13e21eab997cb8e831129879ad0475f70e910de6d8042ad53
7
- data.tar.gz: 5ff23bd27c06791f05426c8470812bd6f0c7521616cdcde5ba6cff47208658a97f3d38caf32f8cfda6f862e5cd62cf37eab63500688f3de012fe7ca158706f29
6
+ metadata.gz: 2e25a6022d48d954920499422fc197bde2bec941d7071f9d6c0fe56dc7072b1f398958b4e87fba60b41aa75eaed3aeaa7aa80ecd52265fdb3b5a69da3b26c804
7
+ data.tar.gz: 4c24f5639552493d4a645c3f2b751d62ecd53e0f085f5383df6116a2796ebac910e7acd130cab6b618eb300e7568572afdd0beef616926833070fcf172a1b9f3
@@ -1,5 +1,4 @@
1
1
  'active_support/concerns'
2
- 'heredity'
3
2
 
4
3
  module Protobuf
5
4
  module ActiveRecord
@@ -7,14 +6,11 @@ module Protobuf
7
6
  extend ::ActiveSupport::Concern
8
7
 
9
8
  included do
10
- include ::Heredity
11
-
12
- inheritable_attributes :_protobuf_field_transformers,
13
- :_protobuf_field_options,
14
- :protobuf_message
15
-
16
- @_protobuf_field_transformers = {}
17
- @_protobuf_field_options = {}
9
+ class << self
10
+ attr_writer :_protobuf_field_transformers,
11
+ :_protobuf_field_options,
12
+ :protobuf_message
13
+ end
18
14
 
19
15
  private :_protobuf_convert_attributes_to_fields
20
16
  private :_protobuf_field_transformers
@@ -42,6 +38,14 @@ module Protobuf
42
38
  return value
43
39
  end
44
40
 
41
+ def _protobuf_field_options
42
+ @_protobuf_field_options ||= {}
43
+ end
44
+
45
+ def _protobuf_field_transformers
46
+ @_protobuf_field_transformers ||= {}
47
+ end
48
+
45
49
  # Define a field transformation from a record. Accepts a Symbol,
46
50
  # callable, or block that is called with the record being serialized.
47
51
  #
@@ -91,7 +95,7 @@ module Protobuf
91
95
  #
92
96
  def protobuf_fields(*fields)
93
97
  options = fields.extract_options!
94
- options[:only] = fields
98
+ options[:only] = fields if fields.present?
95
99
 
96
100
  self._protobuf_field_options = options
97
101
  end
@@ -1,5 +1,5 @@
1
1
  module Protobuf
2
2
  module ActiveRecord
3
- VERSION = "3.0.0.rc2"
3
+ VERSION = "3.0.0.rc3"
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.0.0.rc2
4
+ version: 3.0.0.rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Hutchison