Module Sequel::Plugins::AutoValidations::ClassMethods
In: lib/sequel/plugins/auto_validations.rb

Methods

Attributes

auto_validate_explicit_not_null_columns  [R]  The columns with automatic not_null validations for columns present in the values.
auto_validate_max_length_columns  [R]  The columns or sets of columns with automatic max_length validations, as an array of pairs, with the first entry being the column name and second entry being the maximum length.
auto_validate_not_null_columns  [R]  The columns with automatic not_null validations
auto_validate_options  [R]  Inherited options
auto_validate_unique_columns  [R]  The columns or sets of columns with automatic unique validations

Public Instance methods

Whether to use a presence validation for not null columns

[Source]

     # File lib/sequel/plugins/auto_validations.rb, line 121
121:         def auto_validate_presence?
122:           @auto_validate_presence
123:         end

Whether to automatically validate schema types for all columns

[Source]

     # File lib/sequel/plugins/auto_validations.rb, line 126
126:         def auto_validate_types?
127:           @auto_validate_types
128:         end

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

[Source]

     # File lib/sequel/plugins/auto_validations.rb, line 132
132:         def skip_auto_validations(type)
133:           if type == :all
134:             [:not_null, :types, :unique, :max_length].each{|v| skip_auto_validations(v)}
135:           elsif type == :types
136:             @auto_validate_types = false
137:           else
138:             send("auto_validate_#{type}_columns").clear
139:           end
140:         end

[Validate]