Exception: Mongoid::Errors::Validations
- Defined in:
- lib/mongoid/errors.rb
Overview
Raised when a persisence method ending in ! fails validation. The message will contain the full error messages from the Document
in question.
Example:
Validations.new(person.errors)
Instance Method Summary collapse
-
#initialize(errors) ⇒ Validations
constructor
A new instance of Validations.
- #message ⇒ Object
Constructor Details
#initialize(errors) ⇒ Validations
Returns a new instance of Validations.
65 66 67 |
# File 'lib/mongoid/errors.rb', line 65 def initialize(errors) @errors = errors end |
Instance Method Details
#message ⇒ Object
68 69 70 |
# File 'lib/mongoid/errors.rb', line 68 def "Validation Failed: #{@errors..join(", ")}" end |