lib/dry/schema/macros/dsl.rb in dry-schema-1.2.0 vs lib/dry/schema/macros/dsl.rb in dry-schema-1.3.0
- old
+ new
@@ -198,16 +198,10 @@
type(resolved_type) if set_type
type_predicates = predicate_inferrer[resolved_type]
- unless type_predicates.empty? || predicates.include?(type_predicates)
- if type_predicates.is_a?(::Array) && type_predicates.size.equal?(1)
- predicates.unshift(type_predicates[0])
- else
- predicates.unshift(type_predicates)
- end
- end
+ predicates.replace(type_predicates + predicates) unless type_predicates.empty?
return self if predicates.empty?
end
yield(*predicates, type_spec: type_spec)