Skip to content

Instantly share code, notes, and snippets.

@kwando
Created March 10, 2016 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kwando/7ce19ceb9ba2f12686c7 to your computer and use it in GitHub Desktop.
Save kwando/7ce19ceb9ba2f12686c7 to your computer and use it in GitHub Desktop.
Duplicate error messages
schema = Dry::Validation.Schema {
key(:email).required
key(:name) { size?(5..25) }
}
result = schema.call(email: nil, age: 19, name: 'HN')
errors = result.messages
puts 'out: ' + result.output.inspect
puts errors.inspect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment