Module: Sequel::Plugins::ConstraintValidations::ClassMethods
- Defined in:
- lib/sequel/plugins/constraint_validations.rb
Instance Attribute Summary collapse
-
#constraint_validations ⇒ Object
readonly
An array of validation method call arrays.
-
#constraint_validations_table ⇒ Object
readonly
The name of the table containing the constraint validations metadata.
Instance Method Summary collapse
-
#inherited(subclass) ⇒ Object
Copy the name of the constraint validations metadata table into the subclass.
-
#set_dataset ⇒ Object
Parse the constraint validations from the database whenever the dataset changes.
Instance Attribute Details
#constraint_validations ⇒ Object (readonly)
An array of validation method call arrays. Each array is an array that is splatted to send to perform a validation via validation_helpers.
59 60 61 |
# File 'lib/sequel/plugins/constraint_validations.rb', line 59 def constraint_validations @constraint_validations end |
#constraint_validations_table ⇒ Object (readonly)
The name of the table containing the constraint validations metadata.
62 63 64 |
# File 'lib/sequel/plugins/constraint_validations.rb', line 62 def constraint_validations_table @constraint_validations_table end |
Instance Method Details
#inherited(subclass) ⇒ Object
Copy the name of the constraint validations metadata table into the subclass.
65 66 67 68 |
# File 'lib/sequel/plugins/constraint_validations.rb', line 65 def inherited(subclass) super subclass.instance_variable_set(:@constraint_validations_table, @constraint_validations_table) end |
#set_dataset ⇒ Object
Parse the constraint validations from the database whenever the dataset changes.
72 73 74 75 76 |
# File 'lib/sequel/plugins/constraint_validations.rb', line 72 def set_dataset(*) r = super parse_constraint_validations r end |