graphiti 1.0.rc.24 → 1.0.rc.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: d67c2cb973db323b43cb172e2de8a2b99e363643aaaaf32fe3dfb40136c495d7
4
- data.tar.gz: a2c8f90f58a5d87fa1ec7bba822c0ac8b4e50a59d7ad1d3f0b71e031d97084d8
2
+ SHA1:
3
+ metadata.gz: e884b31c1356a0471c275c586c112935b69872da
4
+ data.tar.gz: 25eeb1ca3e2186817db8484953cbac18224218b6
5
5
  SHA512:
6
- metadata.gz: 8b08c3eb3a4ab96dfeb1af6642004c1b22d052fd6d3e0d897ee9dc8ddbc84430b49623c819fab06e4744673d5fa61e8b4b289df2d79f0853a79b2d1fc4f7c9d7
7
- data.tar.gz: 05c816f48067d09d0d7f498c0dbdd5011d4552d1c720e947bf72513d3a761dec0425ef4d138f49de056833fd1c9998582a8bfabc9d5a26a9889ba91ffb2d605c
6
+ metadata.gz: 8d02eeef86bd4c3762dfa56d78fca03612aed3471ae7718e0ec68fedae6349837938fcc18355bdb15b0fac4512b9144c6dea769ec6a04eaa7c1ec9e39a2812a5
7
+ data.tar.gz: a3260d15370a82010a353fec35c597de65bf66b355747fe3ba80a4be098e0a47c0f876ffa5b40c4ccd9c732ab443d4f9a110bc36619c9691434a9d500a8b62fb
@@ -45,20 +45,22 @@ module Graphiti
45
45
  def each_filter
46
46
  filter_param.each_pair do |param_name, param_value|
47
47
  filter = find_filter!(param_name)
48
- value, operator = normalize_param(filter, param_value)
49
- operator = operator.to_s.gsub("!", "not_").to_sym
50
- validate_operator(filter, operator)
51
48
 
52
- type = Types[filter.values[0][:type]]
53
- unless type[:canonical_name] == :hash || !value.is_a?(String)
54
- value = parse_string_value(filter.values[0], value)
49
+ normalize_param(filter, param_value).each do |operator, value|
50
+ operator = operator.to_s.gsub("!", "not_").to_sym
51
+ validate_operator(filter, operator)
52
+
53
+ type = Types[filter.values[0][:type]]
54
+ unless type[:canonical_name] == :hash || !value.is_a?(String)
55
+ value = parse_string_value(filter.values[0], value)
56
+ end
57
+ validate_singular(resource, filter, value)
58
+ value = coerce_types(filter.values[0], param_name.to_sym, value)
59
+ validate_allowlist(resource, filter, value)
60
+ validate_denylist(resource, filter, value)
61
+ value = value[0] if filter.values[0][:single]
62
+ yield filter, operator, value
55
63
  end
56
- validate_singular(resource, filter, value)
57
- value = coerce_types(filter.values[0], param_name.to_sym, value)
58
- validate_allowlist(resource, filter, value)
59
- validate_denylist(resource, filter, value)
60
- value = value[0] if filter.values[0][:single]
61
- yield filter, operator, value
62
64
  end
63
65
  end
64
66
 
@@ -79,17 +81,16 @@ module Graphiti
79
81
  unless param_value.is_a?(Hash) && param_value.present?
80
82
  param_value = {eq: param_value}
81
83
  end
82
- value = param_value.values.first
83
- operator = param_value.keys.first
84
84
 
85
- if Types[filter.values[0][:type]][:canonical_name] == :hash
86
- value, operator = \
87
- parse_hash_value(filter, param_value, value, operator)
88
- else
89
- value = param_value.values.first
85
+ param_value.map do |operator, value|
86
+ if Types[filter.values[0][:type]][:canonical_name] == :hash
87
+ value, operator = \
88
+ parse_hash_value(filter, param_value, value, operator)
89
+ end
90
+
91
+ [operator, value]
90
92
  end
91
93
 
92
- [value, operator]
93
94
  end
94
95
 
95
96
  def validate_operator(filter, operator)
@@ -1,3 +1,3 @@
1
1
  module Graphiti
2
- VERSION = "1.0.rc.24"
2
+ VERSION = "1.0.rc.25"
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.24
4
+ version: 1.0.rc.25
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-03-15 00:00:00.000000000 Z
11
+ date: 2019-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jsonapi-serializable
@@ -332,7 +332,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
332
332
  version: 1.3.1
333
333
  requirements: []
334
334
  rubyforge_project:
335
- rubygems_version: 2.7.6
335
+ rubygems_version: 2.6.13
336
336
  signing_key:
337
337
  specification_version: 4
338
338
  summary: Easily build jsonapi.org-compatible APIs