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.



209
210
211
# File 'lib/sequel/extensions/constraint_validations.rb', line 209

def validations
  @validations
end

Instance Method Details

#validate(&block) ⇒ Object

Call into the validate DSL for creating constraint validations.



217
218
219
# File 'lib/sequel/extensions/constraint_validations.rb', line 217

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

#validation(opts) ⇒ Object

Add a validation metadata hash to the stored array.



212
213
214
# File 'lib/sequel/extensions/constraint_validations.rb', line 212

def validation(opts)
  @validations << opts
end