Class: EacRailsUtils::NoPresenceValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- EacRailsUtils::NoPresenceValidator
- Defined in:
- app/validators/eac_rails_utils/no_presence_validator.rb
Overview
Instance Method Summary collapse
Instance Method Details
#validate_each(record, attribute, _value) ⇒ Object
6 7 8 9 10 |
# File 'app/validators/eac_rails_utils/no_presence_validator.rb', line 6 def validate_each(record, attribute, _value) return if record.send(attribute).blank? record.errors.add(attribute, [:message] || 'must be blank') end |