lib/dry/validation/schema/value.rb in dry-validation-0.9.4 vs lib/dry/validation/schema/value.rb in dry-validation-0.9.5
- old
+ new
@@ -170,11 +170,11 @@
def respond_to?(name)
self.class.public_methods.include?(name)
end
def infer_predicates(predicates, infer_on = self)
- predicates.map { |predicate|
- name, *args = ::Kernel.Array(predicate).first
+ predicates.flat_map(&::Kernel.method(:Array)).map { |predicate|
+ name, *args = ::Kernel.Array(predicate)
if name.is_a?(Schema)
infer_on.schema(name)
elsif name.respond_to?(:rule)
create_rule(name.rule.to_ast)