Class: Katello::Validators::ContentValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- Katello::Validators::ContentValidator
- Defined in:
- app/lib/katello/validators/content_validator.rb
Instance Method Summary collapse
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
4 5 6 7 8 |
# File 'app/lib/katello/validators/content_validator.rb', line 4 def validate_each(record, attribute, value) value.encode("UTF-8", 'binary') unless value.blank? rescue Encoding::UndefinedConversionError record.errors[attribute] << ([:message] || _("cannot be a binary file.")) end |