Exception: Treequel::ValidationFailed
- Inherits:
-
ModelError
- Object
- RuntimeError
- Error
- ModelError
- Treequel::ValidationFailed
- Defined in:
- lib/treequel/exceptions.rb
Overview
Exception class raised when raise_on_save_failure is set and validation fails
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
the validation errors.
Instance Method Summary collapse
-
#initialize(errors) ⇒ ValidationFailed
constructor
Create a new Treequel::ValidationFailed exception with the given
errors.
Constructor Details
#initialize(errors) ⇒ ValidationFailed
Create a new Treequel::ValidationFailed exception with the given errors.
34 35 36 37 38 39 40 41 |
# File 'lib/treequel/exceptions.rb', line 34 def initialize( errors ) if errors.respond_to?( :full_messages ) @errors = errors super( errors..join(', ') ) else super end end |
Instance Attribute Details
#errors ⇒ Object (readonly)
the validation errors
48 49 50 |
# File 'lib/treequel/exceptions.rb', line 48 def errors @errors end |