Sha256: 642ce195d0dd5765b9e55db6110a9ff413acf57cccbaf240f31c30cc18124143
Contents?: true
Size: 322 Bytes
Versions: 6
Compression:
Stored size: 322 Bytes
Contents
module ActiveModel module Validations class AddressStateValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) return if value.blank? unless value.match /\A^[A-Z ]{2,}\z/i record.errors.add attribute, :state_invalid end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems