lib/dry/schema/message/or.rb in dry-schema-1.9.2 vs lib/dry/schema/message/or.rb in dry-schema-1.9.3
- old
+ new
@@ -15,11 +15,11 @@
msgs = [left, right].flatten
paths = msgs.map(&:path)
if paths.uniq.size == 1
SinglePath.new(left, right, messages)
- elsif right.is_a?(Array)
- if left.is_a?(Array) && paths.uniq.size > 1
+ elsif MultiPath.handler(right)
+ if MultiPath.handler(left) && paths.uniq.size > 1
MultiPath.new(left, right)
else
right
end
else