Class: Vidibus::Inheritance::Validators::AncestorValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- Vidibus::Inheritance::Validators::AncestorValidator
- Defined in:
- lib/vidibus/inheritance/validators/ancestor_validator.rb
Instance Method Summary collapse
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
5 6 7 8 9 |
# File 'lib/vidibus/inheritance/validators/ancestor_validator.rb', line 5 def validate_each(record, attribute, value) unless value.class == record.class record.errors[attribute] << "must be a #{record.class}" end end |