Sha256: 7ac301fab7348afeef9703ceb5d3047f98b401969e3bbcbdd77bba0180beeae5
Contents?: true
Size: 229 Bytes
Versions: 54
Compression:
Stored size: 229 Bytes
Contents
class AsciiOnlyValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) value.encode(Encoding::ASCII) rescue Encoding::UndefinedConversionError record.errors.add(attribute, :ascii) end end
Version data entries
54 entries across 54 versions & 1 rubygems