Sha256: 7fb44c3de4b979556772cd1466dd3724189d5f11fca5072903474214ae95ff39

Contents?: true

Size: 199 Bytes

Versions: 3

Compression:

Stored size: 199 Bytes

Contents

class CpfValidator < ActiveModel::EachValidator
  def validate_each(record, attribute, value)
    record.errors.add(attribute, :invalid, options) unless ValidatesCpf::Cpf.new(value).valid?
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
validates_cpf-2.0.1 lib/validates_cpf/cpf_validator.rb
validates_cpf-2.0.0 lib/cpf_validator.rb
validates_cpf-2.0.0.rc2 lib/cpf_validator.rb