Class: Nifval::NifValidator

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

Instance Method Summary collapse

Instance Method Details

#validate_each(record, attribute, value) ⇒ Object



7
8
9
10
11
# File 'lib/nifval.rb', line 7

def validate_each(record, attribute, value)
  if !is_valid_nif value
    record.errors.add(attribute, I18n.t("nifval.wrong"))
  end
end