Sha256: e2197e057c8d8761caa3a60c689279ac113e5064265cf4b94651a5673793aa7c
Contents?: true
Size: 323 Bytes
Versions: 8
Compression:
Stored size: 323 Bytes
Contents
require "active_model" module Vindetta class Validator < ActiveModel::Validator LENGTH = 17 def self.run(value) Vin.new(value).valid? end def validate(record) record.errors.add(:value, I18n.t("invalid_length")) if record.value.length != LENGTH # TODO: Check format end end end
Version data entries
8 entries across 8 versions & 1 rubygems