Sha256: d93448fd7da9449d4e7298a16c938bbcd1f6688d2bcab8ed48e6eb7f6e6729cc
Contents?: true
Size: 327 Bytes
Versions: 11
Compression:
Stored size: 327 Bytes
Contents
class LegalNamePatternValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) if value.nil? || !value.match(/\A\S+?\s\S+?(?:\s\S+?)?\Z/i) record.errors[attribute] << "must be in the form \"First Last\", \"First Middle Last\", or \"First M Last\" (no prefixes or suffixes)" end end end
Version data entries
11 entries across 11 versions & 1 rubygems