graphiti 1.0.rc.18 → 1.0.rc.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/graphiti/sideload.rb +10 -0
- data/lib/graphiti/sideload/belongs_to.rb +0 -8
- data/lib/graphiti/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: d8967c814b3b30a9726dbba1c4a842678583488b
|
4
|
+
data.tar.gz: da6879ff4f72a21e08ee468473271d6342329d5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d30c8a71c22c4e1d9628dd06a5ed14ca42c63bbe727bb0807b6af5e3ae59b0eede5d9cd38c4ad85a9fa62144685e0173f6c98490d72d05a1405489cdb1f3fcd
|
7
|
+
data.tar.gz: 8abc3efc907913886f694e9ab165bf3492955984cf9467b11d757604429dcbccf7faf06d94f2b9096aa17ec4a170eeec23ae081100effe590339489e53ac9b52
|
data/lib/graphiti/sideload.rb
CHANGED
@@ -190,6 +190,7 @@ module Graphiti
|
|
190
190
|
def load(parents, query, graph_parent)
|
191
191
|
params = load_params(parents, query)
|
192
192
|
params_proc.call(params, parents) if params_proc
|
193
|
+
return [] if blank_query?(params)
|
193
194
|
opts = load_options(parents, query)
|
194
195
|
opts[:sideload] = self
|
195
196
|
opts[:parent] = graph_parent
|
@@ -326,6 +327,15 @@ module Graphiti
|
|
326
327
|
|
327
328
|
private
|
328
329
|
|
330
|
+
def blank_query?(params)
|
331
|
+
if filter = params[:filter]
|
332
|
+
if filter.values == ['']
|
333
|
+
return true
|
334
|
+
end
|
335
|
+
end
|
336
|
+
false
|
337
|
+
end
|
338
|
+
|
329
339
|
def validate_options!(opts)
|
330
340
|
if opts[:remote]
|
331
341
|
if opts[:resource]
|
@@ -10,14 +10,6 @@ class Graphiti::Sideload::BelongsTo < Graphiti::Sideload
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
def load(parents, query, graph_parent)
|
14
|
-
if ids_for_parents(parents).empty?
|
15
|
-
[]
|
16
|
-
else
|
17
|
-
super
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
13
|
def base_filter(parents)
|
22
14
|
parent_ids = ids_for_parents(parents)
|
23
15
|
{ primary_key => parent_ids.join(',') }
|
data/lib/graphiti/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphiti
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.rc.
|
4
|
+
version: 1.0.rc.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lee Richmond
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jsonapi-serializable
|