lib/dry/schema/message_compiler.rb in dry-schema-1.5.6 vs lib/dry/schema/message_compiler.rb in dry-schema-1.6.0

- old
+ new

@@ -129,10 +129,13 @@ Message::Or[left, right, or_translator] end # @api private def or_translator - @or_translator ||= proc { |k| messages.translate(k, **default_lookup_options) } + @or_translator ||= proc { |k| + message = messages.translate(k, **default_lookup_options) + message.is_a?(Hash) ? message[:text] : message + } end # @api private def visit_namespace(node, opts) ns, rest = node