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
41 def initialize(errors=nil)
42   if errors.is_a?(Sequel::Model)
43     @model = errors
44     errors = @model.errors
45   end
46 
47   if errors.respond_to?(:full_messages)
48     @errors = errors
49     super(errors.full_messages.join(', '))
50   else
51     super
52   end
53 end