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.
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 |