Sha256: 3ba2de031a911be57452899fe0e22ad06adb32c9a7bf37dbe87bcc7bc89e1eb9
Contents?: true
Size: 279 Bytes
Versions: 11
Compression:
Stored size: 279 Bytes
Contents
class NameValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) unless value =~ /\A([a-zA-Z'-]+\s+){1,4}[a-zA-Z'-]*\z/i record.errors[attribute] << (options[:message] || I18n.t('flash_validators.errors.messages.name')) end end end
Version data entries
11 entries across 11 versions & 1 rubygems