graphiti 1.0.rc.24 → 1.0.rc.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/graphiti/scoping/filter.rb +21 -20
- data/lib/graphiti/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e884b31c1356a0471c275c586c112935b69872da
|
4
|
+
data.tar.gz: 25eeb1ca3e2186817db8484953cbac18224218b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
53
|
-
|
54
|
-
|
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
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
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)
|
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.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-
|
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.
|
335
|
+
rubygems_version: 2.6.13
|
336
336
|
signing_key:
|
337
337
|
specification_version: 4
|
338
338
|
summary: Easily build jsonapi.org-compatible APIs
|