lib/dry/schema/config.rb in dry-schema-1.13.1 vs lib/dry/schema/config.rb in dry-schema-1.13.2
- old
+ new
@@ -20,10 +20,12 @@
# Return configured predicate registry
#
# @return [Schema::PredicateRegistry]
#
# @api public
- setting :predicates, default: Schema::PredicateRegistry.new
+ setting :predicates, default: PredicateRegistry.new, constructor: -> predicates {
+ predicates.is_a?(PredicateRegistry) ? predicates : PredicateRegistry.new(predicates)
+ }
# @!method types
#
# Return configured container with extra types
#