Sha256: 751932649e40ec7622f7531a342ac8b4e07ec5bafe65c3bf5fa1a11e073694dc
Contents?: true
Size: 284 Bytes
Versions: 11
Compression:
Stored size: 284 Bytes
Contents
class PlanIdPatternValidator < ActiveModel::EachValidator def validate_each record, attribute, value if value.nil? || !value.match(/^(([\w\-]{0,62})?)$/i) record.errors[attribute] << "accepts alphanumeric characters, '-', and '_' only. no spaces" end end end
Version data entries
11 entries across 11 versions & 1 rubygems