Sha256: e0be90601a7d1e694b3824b0184bc19aafd639e2fbc90a806711cca19e186728
Contents?: true
Size: 232 Bytes
Versions: 6
Compression:
Stored size: 232 Bytes
Contents
class SlugValidator < ActiveModel::EachValidator def validate_each(object, attribute, value) unless value =~ /^[a-z0-9-]+$/ object.errors[attribute] << (options[:message] || "is not formatted properly") end end end
Version data entries
6 entries across 6 versions & 1 rubygems