Class: DatabaseValidations::Checkers::DbPresenceValidator
- Inherits:
-
Object
- Object
- DatabaseValidations::Checkers::DbPresenceValidator
- Defined in:
- lib/database_validations/lib/checkers/db_presence_validator.rb
Instance Attribute Summary collapse
-
#validator ⇒ Object
readonly
Returns the value of attribute validator.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(validator) ⇒ DbPresenceValidator
constructor
A new instance of DbPresenceValidator.
- #validate! ⇒ Object
Constructor Details
#initialize(validator) ⇒ DbPresenceValidator
Returns a new instance of DbPresenceValidator.
12 13 14 |
# File 'lib/database_validations/lib/checkers/db_presence_validator.rb', line 12 def initialize(validator) @validator = validator end |
Instance Attribute Details
#validator ⇒ Object (readonly)
Returns the value of attribute validator.
4 5 6 |
# File 'lib/database_validations/lib/checkers/db_presence_validator.rb', line 4 def validator @validator end |
Class Method Details
.validate!(validator) ⇒ Object
7 8 9 |
# File 'lib/database_validations/lib/checkers/db_presence_validator.rb', line 7 def self.validate!(validator) new(validator).validate! end |
Instance Method Details
#validate! ⇒ Object
16 17 18 |
# File 'lib/database_validations/lib/checkers/db_presence_validator.rb', line 16 def validate! validate_foreign_keys! unless ENV['SKIP_DB_UNIQUENESS_VALIDATOR_INDEX_CHECK'] end |