active_remote 3.1.2 → 3.1.3
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 +5 -5
- data/active_remote.gemspec +1 -1
- data/lib/active_remote/attributes.rb +9 -0
- data/lib/active_remote/base.rb +1 -4
- data/lib/active_remote/version.rb +1 -1
- metadata +10 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 072cf73e10eb058b67165e9e6743007a85e735a8
|
4
|
+
data.tar.gz: 40f741027abc44045d101767f1023ffa5980ba9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 371144c02d30eda9c90b25ed7b7b7f64068e4d584e956b451e8f5b48117d72cc49882330936fe7e5d258e31492fc1fb3a5c899db2127ba52af01897dc81ef0ae
|
7
|
+
data.tar.gz: a0eeea285d561ef98c25f0b1b813737c52323ef6cd01b84890065ff945041e715825cc79041b2a6cc45af694dbc0dac91d0662094b59888a789e61c34c607de3
|
data/active_remote.gemspec
CHANGED
@@ -114,6 +114,7 @@ module ActiveRemote
|
|
114
114
|
remove_instance_variable("@attribute_methods_generated") if instance_variable_defined?("@attribute_methods_generated")
|
115
115
|
define_attribute_methods([attribute_definition.name]) unless attribute_names.include?(attribute_name)
|
116
116
|
attributes[attribute_name] = attribute_definition
|
117
|
+
build_default_attributes_hash
|
117
118
|
end
|
118
119
|
end
|
119
120
|
|
@@ -183,6 +184,14 @@ module ActiveRemote
|
|
183
184
|
attribute_method_matchers.map { |matcher| matcher.method_name(name) }
|
184
185
|
end
|
185
186
|
|
187
|
+
def build_default_attributes_hash
|
188
|
+
@default_attributes_hash = Hash[attribute_names.map { |key| [key, nil] }]
|
189
|
+
end
|
190
|
+
|
191
|
+
def default_attributes_hash
|
192
|
+
@default_attributes_hash || {}
|
193
|
+
end
|
194
|
+
|
186
195
|
# Ruby inherited hook to assign superclass attributes to subclasses
|
187
196
|
#
|
188
197
|
def inherited(subclass)
|
data/lib/active_remote/base.rb
CHANGED
@@ -53,10 +53,7 @@ module ActiveRemote
|
|
53
53
|
define_model_callbacks :initialize, :only => :after
|
54
54
|
|
55
55
|
def initialize(attributes = {})
|
56
|
-
@attributes
|
57
|
-
attribute_names = self.class.attribute_names
|
58
|
-
Hash[attribute_names.map { |key| [key, nil] }]
|
59
|
-
end
|
56
|
+
@attributes = self.class.send(:default_attributes_hash).dup
|
60
57
|
|
61
58
|
assign_attributes(attributes) if attributes
|
62
59
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_remote
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Hutchison
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -17,6 +17,9 @@ dependencies:
|
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '4.0'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '5'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -24,6 +27,9 @@ dependencies:
|
|
24
27
|
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '4.0'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '5'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: activesupport
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -262,48 +268,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
262
268
|
version: '0'
|
263
269
|
requirements: []
|
264
270
|
rubyforge_project:
|
265
|
-
rubygems_version: 2.
|
271
|
+
rubygems_version: 2.6.13
|
266
272
|
signing_key:
|
267
273
|
specification_version: 4
|
268
274
|
summary: Active Record for your platform
|
269
|
-
test_files:
|
270
|
-
- spec/lib/active_remote/association_spec.rb
|
271
|
-
- spec/lib/active_remote/attributes_spec.rb
|
272
|
-
- spec/lib/active_remote/base_spec.rb
|
273
|
-
- spec/lib/active_remote/dirty_spec.rb
|
274
|
-
- spec/lib/active_remote/dsl_spec.rb
|
275
|
-
- spec/lib/active_remote/integration_spec.rb
|
276
|
-
- spec/lib/active_remote/persistence_spec.rb
|
277
|
-
- spec/lib/active_remote/primary_key_spec.rb
|
278
|
-
- spec/lib/active_remote/query_attribute_spec.rb
|
279
|
-
- spec/lib/active_remote/rpc_spec.rb
|
280
|
-
- spec/lib/active_remote/scope_keys_spec.rb
|
281
|
-
- spec/lib/active_remote/search_spec.rb
|
282
|
-
- spec/lib/active_remote/serialization_spec.rb
|
283
|
-
- spec/lib/active_remote/serializers/protobuf_spec.rb
|
284
|
-
- spec/lib/active_remote/typecasting_spec.rb
|
285
|
-
- spec/lib/active_remote/validations_spec.rb
|
286
|
-
- spec/spec_helper.rb
|
287
|
-
- spec/support/definitions/author.proto
|
288
|
-
- spec/support/definitions/category.proto
|
289
|
-
- spec/support/definitions/error.proto
|
290
|
-
- spec/support/definitions/post.proto
|
291
|
-
- spec/support/definitions/serializer.proto
|
292
|
-
- spec/support/definitions/tag.proto
|
293
|
-
- spec/support/helpers.rb
|
294
|
-
- spec/support/models.rb
|
295
|
-
- spec/support/models/author.rb
|
296
|
-
- spec/support/models/category.rb
|
297
|
-
- spec/support/models/default_author.rb
|
298
|
-
- spec/support/models/message_with_options.rb
|
299
|
-
- spec/support/models/no_attributes.rb
|
300
|
-
- spec/support/models/post.rb
|
301
|
-
- spec/support/models/tag.rb
|
302
|
-
- spec/support/models/typecasted_author.rb
|
303
|
-
- spec/support/protobuf.rb
|
304
|
-
- spec/support/protobuf/author.pb.rb
|
305
|
-
- spec/support/protobuf/category.pb.rb
|
306
|
-
- spec/support/protobuf/error.pb.rb
|
307
|
-
- spec/support/protobuf/post.pb.rb
|
308
|
-
- spec/support/protobuf/serializer.pb.rb
|
309
|
-
- spec/support/protobuf/tag.pb.rb
|
275
|
+
test_files: []
|