Module: Sequel::Plugins::PgAutoConstraintValidations::ClassMethods
- Defined in:
- lib/sequel/plugins/pg_auto_constraint_validations.rb
Instance Attribute Summary collapse
-
#pg_auto_constraint_validations ⇒ Object
readonly
Hash of metadata checked when an instance attempts to convert a constraint violation into a validation failure.
-
#pg_auto_constraint_validations_messages ⇒ Object
readonly
Hash of error messages keyed by constraint type symbol to use in the generated validation failures.
Instance Method Summary collapse
-
#pg_auto_constraint_validation_override(constraint, columns, message) ⇒ Object
Override the constraint validation columns and message for a given constraint.
Instance Attribute Details
#pg_auto_constraint_validations ⇒ Object (readonly)
Hash of metadata checked when an instance attempts to convert a constraint violation into a validation failure.
82 83 84 |
# File 'lib/sequel/plugins/pg_auto_constraint_validations.rb', line 82 def pg_auto_constraint_validations @pg_auto_constraint_validations end |
#pg_auto_constraint_validations_messages ⇒ Object (readonly)
Hash of error messages keyed by constraint type symbol to use in the generated validation failures.
86 87 88 |
# File 'lib/sequel/plugins/pg_auto_constraint_validations.rb', line 86 def end |
Instance Method Details
#pg_auto_constraint_validation_override(constraint, columns, message) ⇒ Object
Override the constraint validation columns and message for a given constraint
92 93 94 95 96 97 98 99 |
# File 'lib/sequel/plugins/pg_auto_constraint_validations.rb', line 92 def pg_auto_constraint_validation_override(constraint, columns, ) pgacv = Hash[@pg_auto_constraint_validations] overrides = pgacv[:overrides] = Hash[pgacv[:overrides]] overrides[constraint] = [Array(columns), ].freeze overrides.freeze @pg_auto_constraint_validations = pgacv.freeze nil end |