Method: Sequel::Plugins::AutoValidations::ClassMethods#skip_auto_validations
- Defined in:
- lib/sequel/plugins/auto_validations.rb
#skip_auto_validations(type) ⇒ Object
Skip automatic validations for the given validation type (:not_null, :no_null_byte, :types, :unique, :max_length, :max_value, :min_value). If :all is given as the type, skip all auto validations.
Skipping types validation automatically skips max_value and min_value validations, since those validations require valid types.
203 204 205 206 207 208 209 210 211 212 213 214 215 |
# File 'lib/sequel/plugins/auto_validations.rb', line 203 def skip_auto_validations(type) case type when :all [:not_null, :no_null_byte, :types, :unique, :max_length, :max_value, :min_value].each{|v| skip_auto_validations(v)} when :not_null auto_validate_not_null_columns.clear auto_validate_explicit_not_null_columns.clear when :types @auto_validate_types = false else public_send("auto_validate_#{type}_columns").clear end end |