graphiti 1.0.rc.7 → 1.0.rc.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/graphiti/query.rb +1 -1
- data/lib/graphiti/util/remote_params.rb +10 -4
- 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: b5bb7bbf101a447f9036ac8dd26e8ac958180411
|
4
|
+
data.tar.gz: 8634cc52129745771738c95def507df6cf71d73e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9e7dfafa6429aa5ebe4e5dbd273d2cd6294e599c2ac8ee7539917af343f05c9a4f395d0b50dc2ccf8f734986b3b7c38f5f74bc74788b6d3530765965e350a65
|
7
|
+
data.tar.gz: 3cdf7674cd137181b41edbe187ebfd8debb68e50ef0c1f6f15f9de725080dea8b33b4112480f991ae76266f112866a7584349b56c9db693c5919f0ef93ceadba
|
data/lib/graphiti/query.rb
CHANGED
@@ -215,7 +215,7 @@ module Graphiti
|
|
215
215
|
if @resource.remote
|
216
216
|
top_remote_parent = parents.find { |p| p.resource.remote? }
|
217
217
|
[].tap do |chain|
|
218
|
-
parents.each do |p|
|
218
|
+
parents.select { |p| p.resource.remote? }.each do |p|
|
219
219
|
chain << p.association_name unless p == top_remote_parent
|
220
220
|
end
|
221
221
|
immediate_parent = parents.reverse[0]
|
@@ -36,8 +36,8 @@ module Graphiti
|
|
36
36
|
def collect_params(query)
|
37
37
|
query_hash = query.hash
|
38
38
|
process_sorts(query_hash[:sort], query)
|
39
|
-
process_fields(
|
40
|
-
process_extra_fields(
|
39
|
+
process_fields(query.fields.merge(query.hash[:fields] || {}))
|
40
|
+
process_extra_fields(query.extra_fields.merge(query.hash[:extra_fields] || {}))
|
41
41
|
process_filters(query_hash[:filter], query)
|
42
42
|
process_pagination(query_hash[:page], query)
|
43
43
|
process_stats(query_hash[:stats])
|
@@ -76,12 +76,18 @@ module Graphiti
|
|
76
76
|
|
77
77
|
def process_fields(fields)
|
78
78
|
return unless fields
|
79
|
-
|
79
|
+
|
80
|
+
fields.each_pair do |type, attrs|
|
81
|
+
@fields[type] = attrs.join(',')
|
82
|
+
end
|
80
83
|
end
|
81
84
|
|
82
85
|
def process_extra_fields(fields)
|
83
86
|
return unless fields
|
84
|
-
|
87
|
+
|
88
|
+
fields.each_pair do |type, attrs|
|
89
|
+
@extra_fields[type] = attrs.join(',')
|
90
|
+
end
|
85
91
|
end
|
86
92
|
|
87
93
|
def process_sorts(sorts, query)
|
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.8
|
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-01-
|
11
|
+
date: 2019-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jsonapi-serializable
|