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, line 40
def initialize(errors=nil)
  if errors.is_a?(Sequel::Model)
    @model = errors
    errors = @model.errors
  end

  if errors.respond_to?(:full_messages)
    @errors = errors
    super(errors.full_messages.join(', '))
  else
    super
  end
end