graphiti 1.2.36 → 1.2.37
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/graphiti/schema_diff.rb +12 -10
- data/lib/graphiti/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ae9a52df4d54256b453573dc02f8eb2d8b1ad062eec7b38be89e3fbc7c6a9f3
|
4
|
+
data.tar.gz: 99ce6f9e0067eae81661338a933561b2c573b8a78bd92551d6ef5b21a16e6cdf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d77c8c268ef6c44b0557cf50fd3ecdfc71013fd25545cac6a935afd48f7e40caf47045af60649e03bf4f5ee01d8269d05f6be5991bc26a3c6303b7eb2d537afb
|
7
|
+
data.tar.gz: e83bf82263f8b59b2e10a243238c85204631f0eca55ed3306d07129f30d099421d4b518c841bf460187329760d0f9920ff90f5136797cfa1ed13d5cf18d90b3d
|
data/lib/graphiti/schema_diff.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
module Graphiti
|
2
2
|
class SchemaDiff
|
3
3
|
def initialize(old, new)
|
4
|
-
@old = old.deep_symbolize_keys
|
5
|
-
@new = new.deep_symbolize_keys
|
4
|
+
@old = JSON.parse(old.to_json).deep_symbolize_keys
|
5
|
+
@new = JSON.parse(new.to_json).deep_symbolize_keys
|
6
6
|
@errors = []
|
7
7
|
end
|
8
8
|
|
@@ -135,12 +135,12 @@ module Graphiti
|
|
135
135
|
end
|
136
136
|
|
137
137
|
if new_sort[:only] && !old_sort[:only]
|
138
|
-
@errors << "#{old_resource[:name]}: sort #{name.inspect} now limited to only #{new_sort[:only].inspect}."
|
138
|
+
@errors << "#{old_resource[:name]}: sort #{name.inspect} now limited to only #{new_sort[:only].to_sym.inspect}."
|
139
139
|
end
|
140
140
|
|
141
141
|
if new_sort[:only] && old_sort[:only]
|
142
142
|
if new_sort[:only] != old_sort[:only]
|
143
|
-
@errors << "#{old_resource[:name]}: sort #{name.inspect} was limited to only #{old_sort[:only].inspect}, now limited to only #{new_sort[:only].inspect}."
|
143
|
+
@errors << "#{old_resource[:name]}: sort #{name.inspect} was limited to only #{old_sort[:only].to_sym.inspect}, now limited to only #{new_sort[:only].to_sym.inspect}."
|
144
144
|
end
|
145
145
|
end
|
146
146
|
end
|
@@ -212,28 +212,30 @@ module Graphiti
|
|
212
212
|
new_names = new_resource[:filter_group][:names]
|
213
213
|
old_names = old_resource[:filter_group][:names]
|
214
214
|
diff = new_names - old_names
|
215
|
-
if !diff.empty? && new_resource[:filter_group][:required] ==
|
216
|
-
@errors << "#{old_resource[:name]}: all required filter group #{old_names.inspect} added #{"member".pluralize(diff.length)} #{diff.inspect}."
|
215
|
+
if !diff.empty? && new_resource[:filter_group][:required] == "all"
|
216
|
+
@errors << "#{old_resource[:name]}: all required filter group #{old_names.map(&:to_sym).inspect} added #{"member".pluralize(diff.length)} #{diff.map(&:to_sym).inspect}."
|
217
217
|
end
|
218
218
|
|
219
219
|
old_required = old_resource[:filter_group][:required]
|
220
220
|
new_required = new_resource[:filter_group][:required]
|
221
|
-
if old_required ==
|
222
|
-
@errors << "#{old_resource[:name]}: filter group #{old_names.inspect} moved from required: :any to required: :all"
|
221
|
+
if old_required == "any" && new_required == "all"
|
222
|
+
@errors << "#{old_resource[:name]}: filter group #{old_names.map(&:to_sym).inspect} moved from required: :any to required: :all"
|
223
223
|
end
|
224
224
|
else
|
225
|
-
@errors << "#{old_resource[:name]}: filter group #{new_resource[:filter_group][:names].inspect} was added."
|
225
|
+
@errors << "#{old_resource[:name]}: filter group #{new_resource[:filter_group][:names].map(&:to_sym).inspect} was added."
|
226
226
|
end
|
227
227
|
end
|
228
228
|
end
|
229
229
|
|
230
230
|
def compare_stats(old_resource, new_resource)
|
231
|
+
return unless old_resource.key?(:stats)
|
232
|
+
|
231
233
|
old_resource[:stats].each_pair do |name, old_calculations|
|
232
234
|
new_calculations = new_resource[:stats][name]
|
233
235
|
if new_calculations
|
234
236
|
old_calculations.each do |calc|
|
235
237
|
unless new_calculations.include?(calc)
|
236
|
-
@errors << "#{old_resource[:name]}: calculation #{calc.inspect} was removed from stat #{name.inspect}."
|
238
|
+
@errors << "#{old_resource[:name]}: calculation #{calc.to_sym.inspect} was removed from stat #{name.inspect}."
|
237
239
|
end
|
238
240
|
end
|
239
241
|
else
|
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.37
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lee Richmond
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jsonapi-serializable
|