Exception: CouchRest::Model::Errors::Validations
- Inherits:
-
CouchRestModelError
- Object
- StandardError
- CouchRestModelError
- CouchRest::Model::Errors::Validations
- Defined in:
- lib/couchrest/model/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 Attribute Summary collapse
-
#document ⇒ Object
readonly
Returns the value of attribute document.
Instance Method Summary collapse
-
#initialize(document) ⇒ Validations
constructor
A new instance of Validations.
Constructor Details
#initialize(document) ⇒ Validations
Returns a new instance of Validations.
16 17 18 19 |
# File 'lib/couchrest/model/errors.rb', line 16 def initialize(document) @document = document super("Validation Failed: #{@document.errors..join(", ")}") end |
Instance Attribute Details
#document ⇒ Object (readonly)
Returns the value of attribute document.
15 16 17 |
# File 'lib/couchrest/model/errors.rb', line 15 def document @document end |