Exception: Sequel::ValidationFailed

Inherits:
Error show all
Defined in:
lib/sequel/model/exceptions.rb

Overview

Exception class raised when raise_on_save_failure is set and validation fails

Constant Summary

Constants inherited from Error

Error::AdapterNotFound, Error::InvalidOperation, Error::InvalidValue, Error::PoolTimeoutError, Error::Rollback

Instance Attribute Summary collapse

Attributes inherited from Error

#wrapped_exception

Instance Method Summary collapse

Constructor Details

#initialize(errors) ⇒ ValidationFailed

Returns a new instance of ValidationFailed.



18
19
20
21
22
23
24
25
# File 'lib/sequel/model/exceptions.rb', line 18

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)

Returns the value of attribute errors.



26
27
28
# File 'lib/sequel/model/exceptions.rb', line 26

def errors
  @errors
end