Method: PureValidator::ValidationErrors#added?

Defined in:
lib/pure_validator/validation_errors.rb

#added?(attribute, message) ⇒ Boolean

Returns true if an error on the attribute with the given message is present, false otherwise. message is treated the same as for add.

errors.add :name, :blank
errors.added? :name, :blank # => true

Returns:

  • (Boolean)


199
200
201
# File 'lib/pure_validator/validation_errors.rb', line 199

def added?(attribute, message)
  self[attribute].include? message
end