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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4405ad460cc5bf1eb3938463234e3e436a89ac0f
|
4
|
+
data.tar.gz: 44fcf50c1dbfc5f758ae148281adec83ac42d9b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|