Sha256: 7789a126c2ea97036ed4d19dea8278fb1d8850de6c4f6ddc4f2413e3281b8560
Contents?: true
Size: 320 Bytes
Versions: 2
Compression:
Stored size: 320 Bytes
Contents
class Base64Validator < ActiveModel::EachValidator def validate_each(record, attribute, value) unless value =~ /^(?:[A-Za-z0-9+$]{4})*(?:[A-Za-z0-9+$]{2}==|[A-Za-z0-9+$]{3}=|[A-Za-z0-9+$]{4})$/ record.errors[attribute] << (options[:message] || I18n.t('yukonisuru.errors.messages.base64')) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
yukonisuru-1.0.0 | lib/yukonisuru/validators/base64_validator.rb |
yukonisuru-0.0.1 | lib/yukonisuru/validators/base64_validator.rb |