Sha256: ddcad64fb8fe4ce639b3adcb745a5c62d2ad27b0ae37ccfca0a7725f7b227200
Contents?: true
Size: 269 Bytes
Versions: 11
Compression:
Stored size: 269 Bytes
Contents
class FullNamePatternValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) if value.nil? || !value.squeeze(" ").strip.match(/\A\S+?\s\S+?\Z/i) record.errors[attribute] << "First & Last names separated by a space" end end end
Version data entries
11 entries across 11 versions & 1 rubygems