json_api_resource 2.0.0 → 2.1.0

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: 1d1601705bb9dd846cb112a656fab64ad71f8128
4
- data.tar.gz: 01986a0b6f6af3331de1394fb40f0c92d516ad38
3
+ metadata.gz: 1a98d0f34c68af51a8ca8102d654530cc3a7691f
4
+ data.tar.gz: 7732d5602b998a4cdfeeb3678a8cef65e9fb9438
5
5
  SHA512:
6
- metadata.gz: d73fc8efe1f0d87995b012f40e900220eaa4fe1261e5468f3f69bce791ea4e3c98c443e96bd7e40dae642506ddf1737124ebf34551cf0c5c60ee8658b350c7a3
7
- data.tar.gz: 89239740324124cc32de4f453dfc48eed9115a6958c89d156743d110856379f185a17ac51ffaa594541ba75d9d40ac41930cb82e05c168b40e9e428ff1c6e3c7
6
+ metadata.gz: b6f67e35c272601c73a80bb89fc3af1d817f5f029ba5d76dad4474cac1fe20fd27f045929c1f41478595938b5aa2ff3abc915a663e0c029292df3d41e254d7ec
7
+ data.tar.gz: cff9b7c9fab81866d7942adbd47d55f8a23534b63f8655e0507136ab0628d9991d60f5ec28eb5e7c69ccb948fb8d6ce326dcd2cc8ee1b9051b251480359f643f
@@ -27,6 +27,11 @@ module JsonApiResource
27
27
  end
28
28
  rescue Multiconnect::Error::UnsuccessfulRequest => e
29
29
 
30
+ empty_500_set
31
+
32
+ end
33
+
34
+ def empty_500_set
30
35
  result = JsonApiClient::ResultSet.new
31
36
  result.meta = {status: 500}
32
37
 
@@ -40,7 +45,7 @@ module JsonApiResource
40
45
  private
41
46
 
42
47
  def connection
43
- @connection ||= Connections::ServerConnection.new( client: self.client, caching: false )
48
+ @connection ||= Connections::ServerConnection.new( client: self.client )
44
49
  end
45
50
  end
46
51
  end
@@ -21,7 +21,7 @@ module JsonApiResource
21
21
  end
22
22
 
23
23
  def where(opts = {})
24
- opts[:per_page] = opts.fetch(:per_page, self.per_page)
24
+ opts[:per_page] = opts.fetch(:per_page, self.per_page) if self.per_page
25
25
  execute(:where, opts)
26
26
  end
27
27
  end
@@ -86,7 +86,7 @@ module JsonApiResource
86
86
  super
87
87
  end
88
88
  rescue Multiconnect::Error::UnsuccessfulRequest => e
89
- nil
89
+ empty_500_set
90
90
  end
91
91
 
92
92
  def respond_to_missing?(method_name, include_private = false)
@@ -1,3 +1,3 @@
1
1
  module JsonApiResource
2
- VERSION = "2.0.0"
2
+ VERSION = "2.1.0"
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: 2.0.0
4
+ version: 2.1.0
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-12 00:00:00.000000000 Z
11
+ date: 2016-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json_api_client