json_api_resource 3.1.0 → 3.1.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: 550d3bf8b009a60ef20065c2131601ec524a0761
4
- data.tar.gz: 822dca3ef57832f3fecc4c18c0bb1f52e846c1bf
3
+ metadata.gz: 4405ad460cc5bf1eb3938463234e3e436a89ac0f
4
+ data.tar.gz: 44fcf50c1dbfc5f758ae148281adec83ac42d9b4
5
5
  SHA512:
6
- metadata.gz: 21426386df0e1e7bda458f3b3aaeff65cf415cdca85c03792b6ac9079b75a9f8d249d40161b572070463ff596ba30ec7841e9b7d05ba9b18f2609a24138556b2
7
- data.tar.gz: f559ca29883f3f3f5f08800c19825402fdc7520a26f28020c8e26eb53097f6250302a673cd9b03ce2076a1df3fa67724c592d3510f9ca8ab20cd816457866b18
6
+ metadata.gz: acf93bc85f19025b7a84c26f1859abe14983bd90e32755867ca7d0c3a17fdc78682f5287a140210da18932f612639844abed6f8945a29d5c4e1bcdd9953c8102
7
+ data.tar.gz: 82667c8d55f1d33c9fc78c28458947b8eaabf18f1adffb788d76bee9f193814a42e124e1b54dc7cd4ba9d3b74efc017e7275ad3ad96105b42b251fa504961577
@@ -14,13 +14,21 @@ module JsonApiResource
14
14
 
15
15
  def preload( objects )
16
16
  query = bulk_query( objects )
17
- results = klass.send action, query
17
+ if safe? query
18
+ results = klass.send action, query
19
+ else
20
+ results = []
21
+ end
18
22
 
19
23
  distributor.distribute objects, results
20
24
  end
21
25
 
22
26
  private
23
27
 
28
+ def safe?( query )
29
+ query[key].present?
30
+ end
31
+
24
32
  def assign( objects, results )
25
33
  raise NotImplementedError
26
34
  end
@@ -1,3 +1,3 @@
1
1
  module JsonApiResource
2
- VERSION = "3.1.0"
2
+ VERSION = "3.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_api_resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Sislow