Sha256: 5356cd21786b7aa95d7c76d2c1777df552372d36b2547f08cf327cbd2914d4c1

Contents?: true

Size: 234 Bytes

Versions: 1

Compression:

Stored size: 234 Bytes

Contents

class Validator < ActiveModel::EachValidator
  def validate_each(record, attribute, value)
    unless ValidateCpf.new(value).valid?
      record.errors[attribute] << (options[:message] || "this document is invalid")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
validate_cpf-0.1.0 lib/validate_cpf/validator.rb