Module: Sequel::ConstraintValidations::CreateTableGeneratorMethods

Included in:
AlterTableGeneratorMethods
Defined in:
lib/sequel/extensions/constraint_validations.rb

Overview

Additional methods for the create_table generator to support constraint validations.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#validationsObject (readonly)

An array of stored validation metadata, used later by the database to create constraints.



179
180
181
# File 'lib/sequel/extensions/constraint_validations.rb', line 179

def validations
  @validations
end

Instance Method Details

#validate(&block) ⇒ Object

Call into the validate DSL for creating constraint validations.



187
188
189
# File 'lib/sequel/extensions/constraint_validations.rb', line 187

def validate(&block)
  Generator.new(self).process(&block)
end

#validation(opts) ⇒ Object

Add a validation metadata hash to the stored array.



182
183
184
# File 'lib/sequel/extensions/constraint_validations.rb', line 182

def validation(opts)
  @validations << opts
end