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
-
#validations ⇒ Object
readonly
An array of stored validation metadata, used later by the database to create constraints.
Instance Method Summary collapse
-
#validate(&block) ⇒ Object
Call into the validate DSL for creating constraint validations.
-
#validation(opts) ⇒ Object
Add a validation metadata hash to the stored array.
Instance Attribute Details
#validations ⇒ Object (readonly)
An array of stored validation metadata, used later by the database to create constraints.
213 214 215 |
# File 'lib/sequel/extensions/constraint_validations.rb', line 213 def validations @validations end |
Instance Method Details
#validate(&block) ⇒ Object
Call into the validate DSL for creating constraint validations.
221 222 223 |
# File 'lib/sequel/extensions/constraint_validations.rb', line 221 def validate(&block) Generator.new(self).process(&block) end |
#validation(opts) ⇒ Object
Add a validation metadata hash to the stored array.
216 217 218 |
# File 'lib/sequel/extensions/constraint_validations.rb', line 216 def validation(opts) @validations << opts end |