Sha256: 425229edf1d99f2ede609b76670e2899bca6a76ec37de7c3a3ffb14d5545a12f
Contents?: true
Size: 233 Bytes
Versions: 6
Compression:
Stored size: 233 Bytes
Contents
class PostalCodeValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) return if value.blank? if value.to_s.length < 5 record.errors.add attribute, :postal_code_too_short end end end
Version data entries
6 entries across 6 versions & 1 rubygems