app/models/user.rb
# Virtual attribute for the unencrypted password
Virtual attribute for the unencrypted password
Virtual attribute for the unencrypted password
def reset_password
      update_attribute(:password_reset_code, nil)
      @reset_password = true
   end
def reset_password update_attribute ( :password_reset_code , nil ) @reset_password = true end
Virtual attribute for the unencrypted password
Virtual attribute for the unencrypted password
# First update the password_reset_code before setting the # reset_password flag to avoid duplicate email notifications.