Module | Sequel::Plugins::AutoValidations::ClassMethods |
In: |
lib/sequel/plugins/auto_validations.rb
|
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_unique_columns | [R] | The columns or sets of columns with automatic unique validations |
Whether to use a presence validation for not null columns
# File lib/sequel/plugins/auto_validations.rb, line 87 87: def auto_validate_presence? 88: @auto_validate_presence 89: end
Whether to automatically validate schema types for all columns
# File lib/sequel/plugins/auto_validations.rb, line 92 92: def auto_validate_types? 93: @auto_validate_types 94: end
Skip automatic validations for the given validation type (:not_null, :types, :unique). If :all is given as the type, skip all auto validations.
# File lib/sequel/plugins/auto_validations.rb, line 98 98: def skip_auto_validations(type) 99: if type == :all 100: [:not_null, :types, :unique, :max_length].each{|v| skip_auto_validations(v)} 101: elsif type == :types 102: @auto_validate_types = false 103: else 104: send("auto_validate_#{type}_columns").clear 105: end 106: end