Exception: Mongoid::Errors::Validations
- Inherits:
-
MongoidError
- Object
- StandardError
- MongoidError
- Mongoid::Errors::Validations
- Defined in:
- lib/mongoid/errors/validations.rb
Overview
Raised when a persistence method ending in ! fails validation. The message will contain the full error messages from the Document
in question.
Constant Summary
Constants inherited from MongoidError
Instance Attribute Summary collapse
-
#document ⇒ Object
(also: #record)
readonly
Returns the value of attribute document.
Attributes inherited from MongoidError
#problem, #resolution, #summary
Instance Method Summary collapse
-
#initialize(document) ⇒ Validations
constructor
A new instance of Validations.
Methods inherited from MongoidError
Constructor Details
#initialize(document) ⇒ Validations
Returns a new instance of Validations.
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/mongoid/errors/validations.rb', line 16 def initialize(document) @document = document super( ( "validations", { document: document.class, errors: document.errors..join(", ") } ) ) end |
Instance Attribute Details
#document ⇒ Object (readonly) Also known as: record
Returns the value of attribute document.
13 14 15 |
# File 'lib/mongoid/errors/validations.rb', line 13 def document @document end |