Sha256: c2548fa408153f44f01cb6fcd1bf7ff199aeb217229213460b21febc6e25c8cf

Contents?: true

Size: 259 Bytes

Versions: 1

Compression:

Stored size: 259 Bytes

Contents

class PasswordValidator < ActiveModel::EachValidator

  def validate_each(record, attribute, value)
    unless value =~ /^[a-z0-9!@#$%^&*_-]{6,18}$/
      record.errors[attribute] << (options[:message] || I18n.t('errors.messages.password'))
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
flash_validators-0.0.1 lib/flash_validators/validators/password_validator.rb