Method: Authlogic::ActsAsAuthentic::Password::Config#ignore_blank_passwords

Defined in:
lib/authlogic/acts_as_authentic/password.rb

#ignore_blank_passwords(value = nil) ⇒ Object Also known as: ignore_blank_passwords=

By default passwords are required when a record is new or the crypted_password is blank, but if both of these things are met a password is not required. In this case, blank passwords are ignored.

Think about a profile page, where the user can edit all of their information, including changing their password. If they do not want to change their password they just leave the fields blank. This will try to set the password to a blank value, in which case is incorrect behavior. As such, Authlogic ignores this. But let’s say you have a completely separate page for resetting passwords, you might not want to ignore blank passwords. If this is the case for you, then just set this value to false.

  • Default: true

  • Accepts: Boolean

[View source]

75
76
77
# File 'lib/authlogic/acts_as_authentic/password.rb', line 75

def ignore_blank_passwords(value = nil)
  rw_config(:ignore_blank_passwords, value, true)
end