Method: PureValidator::ValidationErrors#include?
- Defined in:
- lib/pure_validator/validation_errors.rb
#include?(attribute) ⇒ Boolean Also known as: has_key?
Returns true if the error messages include an error for the given key attribute, false otherwise.
errors. # => {:name=>["can not be nil"]}
errors.include?(:name) # => true
errors.include?(:age) # => false
23 24 25 |
# File 'lib/pure_validator/validation_errors.rb', line 23 def include?(attribute) (v = [attribute]) && v.any? end |