aequitas
aequitas copied to clipboard
Get descriptive error message from external validator
trafficstars
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.
Currently the validation error generation was dropped. I'll readd validation error message generation as decorators.