Skip to content
This repository has been archived by the owner on May 2, 2019. It is now read-only.

Get descriptive error message from external validator #10

Open
greyblake opened this issue Dec 28, 2012 · 1 comment
Open

Get descriptive error message from external validator #10

greyblake opened this issue Dec 28, 2012 · 1 comment

Comments

@greyblake
Copy link

Lets say I have the next model and external validator:

class User
  attr_accessor :name, :age
end

class UserValidator
  include Aequitas
  validates_presence_of :name
end


user = User.new
validator = UserValidator.new(user)

puts validator.valid?  # => false, as expected

How do I get error messages from validator? I see #on method but it returns set of rules.

@mbj
Copy link
Collaborator

mbj commented Dec 28, 2012

Currently the validation error generation was dropped. I'll readd validation error message generation as decorators.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants