Module: Sequel::Plugins::ValidationClassMethods

Defined in:
lib/sequel/lib/sequel/plugins/validation_class_methods.rb

Overview

Sequel's built-in validation_class_methods plugin adds backwards compatibility for the legacy class-level validation methods (e.g. validates_presence_of :column).

It is recommended to use the validation_helpers plugin instead of this one, as it is less complex and more flexible.

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.apply(model) ⇒ Object

Setup the validations hash for the given model.


12
13
14
15
16
17
# File 'lib/sequel/lib/sequel/plugins/validation_class_methods.rb', line 12

def self.apply(model)
  model.class_eval do
    @validation_mutex = Mutex.new
    @validations = {}
  end
end