class Sequel::ValidationFailed

  1. lib/sequel/model/exceptions.rb
Superclass: Error

Exception class raised when raise_on_save_failure is set and validation fails

Methods

Public Class

  1. new

Public Instance

  1. errors
  2. model

Attributes

errors [R]

The Sequel::Model::Errors object related to this exception.

model [R]

The Sequel::Model object related to this exception.

Public Class methods

new(errors=nil)
[show source]
   # File lib/sequel/model/exceptions.rb
53 def initialize(errors=nil)
54   if errors.is_a?(Sequel::Model)
55     @model = errors
56     errors = @model.errors
57   end
58 
59   if errors.respond_to?(:full_messages)
60     @errors = errors
61     super(errors.full_messages.join(', '))
62   else
63     super
64   end
65 end