graphiti 1.2.9 → 1.2.10
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: baac052d897009c65c320247e4ff008050b898d700ccab49e08e0e9276fc75ce
|
4
|
+
data.tar.gz: 5d9687d68e3bed0a700f2b534dceedc5989e01b2b9863e4173f5f9bdf277f424
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 004d5f12a5dc29edeae1f6a332644580efd30530144d9a850a83cf904b43be16ff30a699bb24fa81e7e6eabca952972ca4cbcce1c3a46d6c1ad5d95d5cc58ddd
|
7
|
+
data.tar.gz: 5927f6e81eb5ec26964549ace950d4667390cd78649c1aebbc10d97810de80e33af83e7dad541e552f09a61419b1682eba2091f4264ad6cc8d92da5f60cf81fb
|
@@ -93,7 +93,7 @@ module Graphiti
|
|
93
93
|
|
94
94
|
run_callbacks :persistence, :update, update_params, meta do
|
95
95
|
run_callbacks :attributes, :update, update_params, meta do |params|
|
96
|
-
model_instance = self.class._find(
|
96
|
+
model_instance = self.class._find(id: id).data
|
97
97
|
call_with_meta(:assign_attributes, model_instance, params, meta)
|
98
98
|
model_instance
|
99
99
|
end
|
@@ -79,12 +79,18 @@ module Graphiti
|
|
79
79
|
end
|
80
80
|
|
81
81
|
def normalize_param(filter, param_value)
|
82
|
-
|
83
|
-
|
82
|
+
type = Types[filter.values[0][:type]][:canonical_name]
|
83
|
+
if param_value.is_a?(Hash) && type == :hash
|
84
|
+
operators_keys = filter.values[0][:operators].keys
|
85
|
+
unless param_value.keys.all? {|k| operators_keys.include?(k)}
|
86
|
+
param_value = { eq: param_value }
|
87
|
+
end
|
88
|
+
elsif !param_value.is_a?(Hash) || param_value.empty?
|
89
|
+
param_value = { eq: param_value }
|
84
90
|
end
|
85
91
|
|
86
92
|
param_value.map do |operator, value|
|
87
|
-
if
|
93
|
+
if type == :hash
|
88
94
|
value, operator = \
|
89
95
|
parse_hash_value(filter, param_value, value, operator)
|
90
96
|
end
|
@@ -136,7 +142,7 @@ module Graphiti
|
|
136
142
|
end
|
137
143
|
|
138
144
|
if value.is_a?(String)
|
139
|
-
value = value.gsub("{{{", "{").gsub("}}}", "}")
|
145
|
+
value = value.gsub("{{{", "{").gsub("}}}", "}") unless filter.values[0][:single]
|
140
146
|
|
141
147
|
if value.include?("},{") && !filter.values[0][:single]
|
142
148
|
value = Util::Hash.split_json(value)
|
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.2.
|
4
|
+
version: 1.2.10
|
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-
|
11
|
+
date: 2019-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jsonapi-serializable
|