Class: Nif::NifValidator

Inherits:
ActiveModel::EachValidator
  • Object
show all
Defined in:
lib/nif.rb

Instance Method Summary collapse

Instance Method Details

#validate_each(record, attribute, value) ⇒ Object



62
63
64
# File 'lib/nif.rb', line 62

def validate_each(record, attribute, value)
  record.errors.add(attribute, :invalid) unless Nif::Validator.validate(value)
end