module Sequel::Plugins::AutoValidations::ClassMethods

  1. lib/sequel/plugins/auto_validations.rb
Parent: AutoValidations

Attributes

auto_validate_explicit_not_null_columns [R]

The columns with automatic not_null validations for columns present in the values.

auto_validate_not_null_columns [R]

The columns with automatic not_null validations

auto_validate_unique_columns [R]

The columns or sets of columns with automatic unique validations

Public Instance methods

auto_validate_presence? ()

Whether to use a presence validation for not null columns

[show source]
# File lib/sequel/plugins/auto_validations.rb, line 81
def auto_validate_presence?
  @auto_validate_presence
end
auto_validate_types? ()

Whether to automatically validate schema types for all columns

[show source]
# File lib/sequel/plugins/auto_validations.rb, line 86
def auto_validate_types?
  @auto_validate_types
end
skip_auto_validations (type)

Skip automatic validations for the given validation type (:not_null, :types, :unique). If :all is given as the type, skip all auto validations.

[show source]
# File lib/sequel/plugins/auto_validations.rb, line 92
def skip_auto_validations(type)
  if type == :all
    [:not_null, :types, :unique].each{|v| skip_auto_validations(v)}
  elsif type == :types
    @auto_validate_types = false
  else
    send("auto_validate_#{type}_columns").clear
  end
end