lib/dry/schema/macros/dsl.rb in dry-schema-1.0.3 vs lib/dry/schema/macros/dsl.rb in dry-schema-1.1.0
- old
+ new
@@ -64,12 +64,13 @@
# required(:name).filled(:string, format?: /\w+/)
#
# @return [Macros::Core]
#
# @api public
- def filled(*args, &block)
+ def filled(*args, **opts, &block)
append_macro(Macros::Filled) do |macro|
- macro.call(*args, &block)
+ filter(:filled?) if opts[:type_spec] && macro.filter?
+ macro.call(*args, **opts, &block)
end
end
# Specify a nested hash without enforced `hash?` type-check
#