Class: AssociationLengthValidator
- Inherits:
-
ActiveModel::Validations::LengthValidator
- Object
- ActiveModel::Validations::LengthValidator
- AssociationLengthValidator
- Defined in:
- lib/association_length_validator.rb
Instance Method Summary collapse
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
2 3 4 5 6 7 |
# File 'lib/association_length_validator.rb', line 2 def validate_each(record, attribute, value) value = value.reject(&:marked_for_destruction?) value = select_items(record, value, [:select]) if [:select] super(record, attribute, value) end |