From 09cb2ba8151a60056f4d17fb448ed79c31f02bee Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 24 Sep 2013 22:12:48 +0300 Subject: [PATCH] Fix password update --- app/controllers/profiles_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb index 780f47d99..75f12f8a6 100644 --- a/app/controllers/profiles_controller.rb +++ b/app/controllers/profiles_controller.rb @@ -33,8 +33,8 @@ class ProfilesController < ApplicationController end def update_password - params[:user].select! do |key, value| - %w(current_password password password_confirmation).include?(key.to_s) + password_attributes = params[:user].select do |key, value| + %w(password password_confirmation).include?(key.to_s) end unless @user.valid_password?(params[:user][:current_password]) @@ -42,7 +42,7 @@ class ProfilesController < ApplicationController return end - if @user.update_attributes(params[:user]) + if @user.update_attributes(password_attributes) flash[:notice] = "Password was successfully updated. Please login with it" redirect_to new_user_session_path else -- 2.11.0