Sha256: 99df6ab88f01674d638e48ea37fbdf9c2f595e99c11cba8c07eef6b8514b49fb

Contents?: true

Size: 941 Bytes

Versions: 15

Compression:

Stored size: 941 Bytes

Contents

module Sequel
  # Exception class raised when +raise_on_save_failure+ is set and a before hook returns false
  # or an around hook doesn't call super or yield.
  class HookFailed < Error; end

  # Deprecated alias for HookFailed, kept for backwards compatibility
  BeforeHookFailed = HookFailed
  
  # Exception class raised when +require_modification+ is set and an UPDATE or DELETE statement to modify the dataset doesn't
  # modify a single row.
  class NoExistingObject < Error; end
  
  # Raised when an undefined association is used when eager loading.
  class UndefinedAssociation < Error; end
  
  # Exception class raised when +raise_on_save_failure+ is set and validation fails
  class ValidationFailed < Error
    def initialize(errors)
      if errors.respond_to?(:full_messages)
        @errors = errors
        super(errors.full_messages.join(', '))
      else
        super
      end
    end
    attr_reader :errors
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
sequel-3.38.0 lib/sequel/model/exceptions.rb
sequel-3.37.0 lib/sequel/model/exceptions.rb
sequel-3.36.1 lib/sequel/model/exceptions.rb
sequel-3.36.0 lib/sequel/model/exceptions.rb
sequel-3.35.0 lib/sequel/model/exceptions.rb
sequel-3.34.1 lib/sequel/model/exceptions.rb
sequel-3.34.0 lib/sequel/model/exceptions.rb
sequel-3.33.0 lib/sequel/model/exceptions.rb
sequel-3.32.0 lib/sequel/model/exceptions.rb
sequel-3.31.0 lib/sequel/model/exceptions.rb
sequel-3.30.0 lib/sequel/model/exceptions.rb
sequel-3.29.0 lib/sequel/model/exceptions.rb
sequel-3.28.0 lib/sequel/model/exceptions.rb
sequel-3.27.0 lib/sequel/model/exceptions.rb
sequel-3.26.0 lib/sequel/model/exceptions.rb