Class: Katello::Validators::LibraryPresenceValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- Katello::Validators::LibraryPresenceValidator
- Defined in:
- app/lib/katello/validators/library_presence_validator.rb
Instance Method Summary collapse
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
4 5 6 |
# File 'app/lib/katello/validators/library_presence_validator.rb', line 4 def validate_each(record, attribute, value) record.errors[attribute] << N_("must contain '%s'") % "Library" if value.select { |e| e.library }.empty? end |