aequitas icon indicating copy to clipboard operation
aequitas copied to clipboard

Get descriptive error message from external validator

Open greyblake opened this issue 12 years ago • 1 comments
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.

greyblake avatar Dec 28 '12 14:12 greyblake

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

mbj avatar Dec 28 '12 14:12 mbj