lib/dry/schema/key_validator.rb in dry-schema-1.5.2 vs lib/dry/schema/key_validator.rb in dry-schema-1.5.3
- old
+ new
@@ -26,10 +26,10 @@
input_paths.each do |path|
error_path =
if path[INDEX_REGEX]
key = path.gsub(INDEX_REGEX, BRACKETS)
- unless key_paths.include?(key)
+ if key_paths.none? { |key_path| key_path.include?(key) }
arr = path.gsub(INDEX_REGEX) { |m| ".#{m[1]}" }
arr.split(DOT).map { |s| DIGIT_REGEX.match?(s) ? s.to_i : s.to_sym }
end
elsif !key_paths.include?(path)
path