graphiti 1.0.beta.19 → 1.0.beta.20

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: 3227e3c0a0c6d7e91585d1d32d25815b8b53cff0
4
- data.tar.gz: e28ab3bd45aaab7ad71c58d6e04ae212671efb3b
3
+ metadata.gz: 9ac056ea53da51436d7397f5e70165e5a5b0d4f0
4
+ data.tar.gz: c30c9910b949040f7d4ebe0bd2c8fa64a0f45e61
5
5
  SHA512:
6
- metadata.gz: '089f15dc9d6b3a94159bc3578435a96010948ba3d1c0ff93d3ef5f3fdb6398cc2c66d2c32c5457a658db0073d9f022d5c4693b6fc67deef38c0d805f7ee8e3fc'
7
- data.tar.gz: 53aeef332b2dfc773c40611efceb30f5cddbc1ab95b69c5aad80487deae06473ea07f064fbc4dfbf514c74b385cf204a8af88bb6a0890dd919e3b95dff2d402b
6
+ metadata.gz: 1ce89753aaca2ea2d2740551085a42b7be139269f8e4e8d03815270c962484cda25e868548dc9058278f2cf8e8a54faa5541df16356f29e20784df24ea6329fc
7
+ data.tar.gz: e9101c3dbf5814b975d4ddd3199e5153750649e6c0dd4303a60c68703c2759904629a55bc4c71ae79c88b97057c11fff974a91ea2d12c28bf7181c04d00ceee0
@@ -48,7 +48,9 @@ module Graphiti
48
48
  value, operator = normalize_param(filter, param_value)
49
49
  operator = operator.to_s.gsub('!', 'not_').to_sym
50
50
  validate_operator(filter, operator)
51
- value = parse_string_value(filter.values[0], value) if value.is_a?(String)
51
+ unless filter.values[0][:type] == :hash || !value.is_a?(String)
52
+ value = parse_string_value(filter.values[0], value)
53
+ end
52
54
  validate_singular(resource, filter, value)
53
55
  value = coerce_types(filter.values[0], param_name.to_sym, value)
54
56
  validate_allowlist(resource, filter, value)
@@ -130,6 +132,17 @@ module Graphiti
130
132
 
131
133
  if value.is_a?(String)
132
134
  value = value.gsub('{{{', '{').gsub('}}}', '}')
135
+
136
+ # Accomodate array of hashes
137
+ if value.include?('},{')
138
+ value = value.split('},{').map do |v|
139
+ if v.starts_with?('{') && !v.ends_with?('}')
140
+ v = "#{v}}"
141
+ elsif v.ends_with?('}') && !v.starts_with?('{')
142
+ v = "{#{v}"
143
+ end
144
+ end
145
+ end
133
146
  end
134
147
 
135
148
  [value, operator]
@@ -1,3 +1,3 @@
1
1
  module Graphiti
2
- VERSION = "1.0.beta.19"
2
+ VERSION = "1.0.beta.20"
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.beta.19
4
+ version: 1.0.beta.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Richmond
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-12-13 00:00:00.000000000 Z
11
+ date: 2018-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jsonapi-serializable