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)
-
- (Object) document
readonly
Returns the value of attribute document.
Instance Method Summary (collapse)
-
- (Validations) initialize(document)
constructor
A new instance of Validations.
Constructor Details
- (Validations) initialize(document)
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
- (Object) document (readonly)
Returns the value of attribute document
15 16 17 |
# File 'lib/couchrest/model/errors.rb', line 15 def document @document end |