Class: ActiveStorageValidations::AttachedValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- ActiveStorageValidations::AttachedValidator
- Includes:
- ErrorHandler
- Defined in:
- lib/active_storage_validations/attached_validator.rb
Overview
:nodoc:
Instance Method Summary collapse
Methods included from ErrorHandler
#add_error, #initialize_error_options
Instance Method Details
#validate_each(record, attribute, _value) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/active_storage_validations/attached_validator.rb', line 7 def validate_each(record, attribute, _value) return if record.send(attribute).attached? = () add_error(record, attribute, :blank, **) end |