Module Devise::Models::Validatable
In: lib/devise/models/validatable.rb

Validatable creates all needed validations for a user email and password. It‘s optional, given you may want to create the validations by yourself. Automatically validate if the email is present, unique and its format is valid. Also tests presence of password, confirmation and length.

Options

Validatable adds the following options to devise_for:

  * +email_regexp+: the regular expression used to validate e-mails;
  * +password_length+: a range expressing password length. Defaults to 6..128.

Methods

Classes and Modules

Module Devise::Models::Validatable::ClassMethods

Constants

VALIDATIONS = [ :validates_presence_of, :validates_uniqueness_of, :validates_format_of, :validates_confirmation_of, :validates_length_of ].freeze   All validations used by this module.

Public Class methods

Protected Instance methods

Checks whether a password is needed or not. For validations only. Passwords are always required if it‘s a new record, or if the password or confirmation are being set somewhere.

[Validate]