Sha256: 2b787688655a0d276952b2f0427625d100663ddad37b50295706427f2f6bfe84
Contents?: true
Size: 254 Bytes
Versions: 11
Compression:
Stored size: 254 Bytes
Contents
class SlugValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) unless value =~ /^[a-z0-9-]+$/ record.errors[attribute] << (options[:message] || I18n.t('flash_validators.errors.messages.slug')) end end end
Version data entries
11 entries across 11 versions & 1 rubygems