module Sequel::Plugins::ConstraintValidations::ClassMethods

Attributes

constraint_validation_reflections[R]

A hash of reflections of constraint validations. Keys are type name symbols. Each value is an array of pairs, with the first element being the validation type symbol (e.g. :presence) and the second element being options for the validation. If the validation takes an argument, it appears as the :argument entry in the validation option hash.

constraint_validations[R]

An array of validation method call arrays. Each array is an array that is splatted to send to perform a validation via validation_helpers.

constraint_validations_table[R]

The name of the table containing the constraint validations metadata.

Public Instance Methods

freeze() click to toggle source

Freeze constraint validations data when freezing model class.

# File lib/sequel/plugins/constraint_validations.rb, line 94
def freeze
  @constraint_validations.freeze.each(&:freeze)
  @constraint_validation_reflections.freeze.each_value do |v|
    v.freeze
    v.each(&:freeze)
  end
  @constraint_validation_options.freeze.each_value(&:freeze)

  super
end