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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 64397d57cb7c6414bb46e577ab78b0a603d1873a
4
- data.tar.gz: 9feb0b39e7dce3d6a6899e1b78495b97bd53509a
3
+ metadata.gz: b5bb7bbf101a447f9036ac8dd26e8ac958180411
4
+ data.tar.gz: 8634cc52129745771738c95def507df6cf71d73e
5
5
  SHA512:
6
- metadata.gz: f9a163bee97a77e99ad461cc5ebf48c1bdab164e1308fb0bdb13e96eb4ec9036b0e9bfc916ebe1e67ac5a5df5fea7360baef7afaf6fc37cc9132f92569988cc4
7
- data.tar.gz: 44fc30042c0cbc1567b1127ebffa09c538a56dd8e0884dd23ed63d1bfbce6489e3c7d6de1f707fe6378e36bc95d09aede3646d76c47276eb2999e9c58e2af3df
6
+ metadata.gz: a9e7dfafa6429aa5ebe4e5dbd273d2cd6294e599c2ac8ee7539917af343f05c9a4f395d0b50dc2ccf8f734986b3b7c38f5f74bc74788b6d3530765965e350a65
7
+ data.tar.gz: 3cdf7674cd137181b41edbe187ebfd8debb68e50ef0c1f6f15f9de725080dea8b33b4112480f991ae76266f112866a7584349b56c9db693c5919f0ef93ceadba
@@ -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(query_hash[:fields])
40
- process_extra_fields(query_hash[: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
- @fields[fields.keys.first.to_sym] = fields.values.join(',')
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
- @extra_fields[fields.keys.first.to_sym] = fields.values.join(',')
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)
@@ -1,3 +1,3 @@
1
1
  module Graphiti
2
- VERSION = "1.0.rc.7"
2
+ VERSION = "1.0.rc.8"
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.7
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-24 00:00:00.000000000 Z
11
+ date: 2019-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jsonapi-serializable