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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: afaf92e3ca234c7c84974f05ebd8feae5b532fe0
4
- data.tar.gz: ad2985a29b2601440f52d86d5458d70f736a5ff5
3
+ metadata.gz: d8967c814b3b30a9726dbba1c4a842678583488b
4
+ data.tar.gz: da6879ff4f72a21e08ee468473271d6342329d5a
5
5
  SHA512:
6
- metadata.gz: 06cada17b7a5d38dbe04cfccf481b5a52c1218fe87fb04cd665e35ee777c0c726484467173367e5b375d9f42626526c4627875a1eec7533c4e63628d4d4f5305
7
- data.tar.gz: b4b7ba5cbce5c57e45b5789e3e36cff0467b62ae0208b6dfadee59ad95b98ab9ff498be68816e6404bb9d0772fd0d411bed129b7785cf3b14507853fda6c0771
6
+ metadata.gz: 9d30c8a71c22c4e1d9628dd06a5ed14ca42c63bbe727bb0807b6af5e3ae59b0eede5d9cd38c4ad85a9fa62144685e0173f6c98490d72d05a1405489cdb1f3fcd
7
+ data.tar.gz: 8abc3efc907913886f694e9ab165bf3492955984cf9467b11d757604429dcbccf7faf06d94f2b9096aa17ec4a170eeec23ae081100effe590339489e53ac9b52
@@ -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(',') }
@@ -1,3 +1,3 @@
1
1
  module Graphiti
2
- VERSION = "1.0.rc.18"
2
+ VERSION = "1.0.rc.19"
3
3
  end
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.18
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-20 00:00:00.000000000 Z
11
+ date: 2019-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jsonapi-serializable