Exception: Treequel::ValidationFailed

Inherits:
ModelError show all
Defined in:
lib/treequel/exceptions.rb

Overview

Exception class raised when raise_on_save_failure is set and validation fails

Instance Attribute Summary collapse

Instance Method Summary collapse

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.full_messages.join(', ') )
	else
		super
	end
end

Instance Attribute Details

#errorsObject (readonly)

the validation errors



48
49
50
# File 'lib/treequel/exceptions.rb', line 48

def errors
  @errors
end