app/models/user.rb
# This method is only used by devise-security to determine
# whether or not password validations should run.
# A better name would be password_validations_required?
# but that's just my humble opinion.
# See https://github.com/devise-security/devise-security/blob/master/lib/devise-security/models/secure_validatable.rb#L54
#
# By default passwords are validated for new records,
# or when the password or password_confirmation are being set.
# We override here because we only want to run validations
# for persisted, locally authenticated users.
# New locally authenticated users get a valid password set
# by UserForm#set_password.
This method is only used by devise-security to determine
whether or not password validations should run.
A better name would be password_validations_required.
but that's just my humble opinion.

By default passwords are validated for new records,
or when the password or password_confirmation are being set.
We override here because we only want to run validations
for persisted, locally authenticated users.
New locally authenticated users get a valid password set
by UserForm#set_password.
This method is only used by devise - security to determine whether or not password validations should run . A better name would be password_validations_required . but that ' s just my humble opinion . By default passwords are validated for new records or when the password or password_confirmation are being set . We override here because we only want to run validations for persisted locally authenticated users . New locally authenticated users get a valid password set by UserForm#set_password .
def password_required?
    return false unless persisted? && authenticated_locally?
    super
  end
def password_required? return false unless persisted? && authenticated_locally? super end
This method is only used by devise-security to determine
whether or not password validations should run.
This method is only used by devise - security to determine whether or not password validations should run .