json_api_resource 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/json_api_resource/resource.rb +2 -2
- data/lib/json_api_resource/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d614a8696dc5d0a00cec60e488cc0bf2525b90f0
|
4
|
+
data.tar.gz: 98c045571f29a19bc8923631bc536a5605c049b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1ab7d5d28bcd0d327469b3d8a0c96900df625288b0f5e7cd926dbc2b867a282ee23b1ed69834c3192a8361451451bf11cb7011fa52fd59a683e3116e83b778f
|
7
|
+
data.tar.gz: 3a8b5589a2cab870d1a1548a7afdb659f2dde36fa655d16d2d36e7e1959703a1beede2621791197cbd6709c60917bdd3884ae9dab60a46c3ef9794b3f43b8a99
|
data/README.md
CHANGED
@@ -142,7 +142,7 @@ The object will still reply to `id`, `name` and `permissions`, but you won't be
|
|
142
142
|
|
143
143
|
### Error Handling
|
144
144
|
|
145
|
-
On an unsuccessful call to the server (this means that if you have multiple connections, they will *necessarily **all
|
145
|
+
On an unsuccessful call to the server (this means that if you have multiple connections, they will *necessarily* **all** have to fail), errors will be routed through an overridable `handle_failed_request(e)` method. By default it will re-raise the error, but you can handle it any way you want.
|
146
146
|
|
147
147
|
### Other Features
|
148
148
|
|
@@ -33,9 +33,8 @@ module JsonApiResource
|
|
33
33
|
def initialize(opts={})
|
34
34
|
raise( JsonApiResource::Errors::JsonApiResourceError, class: self.class, message: "A resource must have a client class" ) unless client_class.present?
|
35
35
|
|
36
|
-
self.client = self.client_class.new(self.schema)
|
37
|
-
self.errors = ActiveModel::Errors.new(self)
|
38
36
|
self.attributes = opts
|
37
|
+
self.errors = ActiveModel::Errors.new(self)
|
39
38
|
self.populate_missing_fields
|
40
39
|
end
|
41
40
|
|
@@ -54,6 +53,7 @@ module JsonApiResource
|
|
54
53
|
elsif client_params
|
55
54
|
self.client = client_params
|
56
55
|
else
|
56
|
+
self.client ||= self.client_class.new(self.schema)
|
57
57
|
self.client.attributes = attr
|
58
58
|
end
|
59
59
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_api_resource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Sislow
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json_api_client
|