Exception: Ripple::DocumentInvalid
- Includes:
- Translation
- Defined in:
- lib/ripple/validations.rb
Overview
Raised by save!
when the document is invalid. Use the document
method to retrieve the document which did not validate.
begin
invalid_document.save!
rescue Ripple::DocumentInvalid => invalid
puts invalid.document.errors
end
Instance Attribute Summary collapse
-
#document ⇒ Object
readonly
Returns the value of attribute document.
Instance Method Summary collapse
-
#initialize(document) ⇒ DocumentInvalid
constructor
A new instance of DocumentInvalid.
Methods included from Translation
Constructor Details
#initialize(document) ⇒ DocumentInvalid
Returns a new instance of DocumentInvalid.
17 18 19 20 21 |
# File 'lib/ripple/validations.rb', line 17 def initialize(document) @document = document errors = @document.errors..join(", ") super(t("document_invalid", :errors => errors)) end |
Instance Attribute Details
#document ⇒ Object (readonly)
Returns the value of attribute document.
16 17 18 |
# File 'lib/ripple/validations.rb', line 16 def document @document end |