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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9b9f3ccf729b8b0bfbc9493560e0395e61c8bdf0
4
- data.tar.gz: cd57899d7f64b8543eeaa99922d6682efba9ddde
3
+ metadata.gz: d614a8696dc5d0a00cec60e488cc0bf2525b90f0
4
+ data.tar.gz: 98c045571f29a19bc8923631bc536a5605c049b4
5
5
  SHA512:
6
- metadata.gz: d9ca5e0bead24edeb4a147d9873e3e972fe415db39342b61471fdbaa684b23c84160c0907e0ab11c3b24cc828e3bfe40614bf5f588bcb71aeac905757af2c2f1
7
- data.tar.gz: d1659f6cf7efdcce11f51b4a2d6235fb65ae237708ce528ed18970168ee070e167a4df3f75d9a2486a23e97839d4edb4002b480d1ac0ac520c2e05970c55631c
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*** 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.
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
@@ -1,3 +1,3 @@
1
1
  module JsonApiResource
2
- VERSION = "3.0.0"
2
+ VERSION = "3.0.1"
3
3
  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.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-04-26 00:00:00.000000000 Z
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