You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
module MyPredicates
include Dry::Validation::Predicates
predicate(:uuid?) do |input|
! /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.match(input).nil?
end
end
class Schema < Dry::Validation::Schema
configure do |config|
config.predicates = MyPredicates
end
key(:id) { |value| value.str? & value.uuid? }
end
When I am writing:
Schema.new.messages({ id: "aaa" })
I always receive:
NoMethodError: undefined method `visit_uuid?' for #<Dry::Validation::ErrorCompiler:0x007f83c40c31f0>
The text was updated successfully, but these errors were encountered:
Oh of course, sorry about that. I need to clean-up error message compiler and provide a fall-back visitor for generic predicate messages. Will do it today.
Based on example in README
When I am writing:
I always receive:
The text was updated successfully, but these errors were encountered: