Commit 09cb2ba8151a60056f4d17fb448ed79c31f02bee

Authored by Dmitriy Zaporozhets
1 parent ffd0a985

Fix password update

Showing 1 changed file with 3 additions and 3 deletions   Show diff stats
app/controllers/profiles_controller.rb
... ... @@ -33,8 +33,8 @@ class ProfilesController < ApplicationController
33 33 end
34 34  
35 35 def update_password
36   - params[:user].select! do |key, value|
37   - %w(current_password password password_confirmation).include?(key.to_s)
  36 + password_attributes = params[:user].select do |key, value|
  37 + %w(password password_confirmation).include?(key.to_s)
38 38 end
39 39  
40 40 unless @user.valid_password?(params[:user][:current_password])
... ... @@ -42,7 +42,7 @@ class ProfilesController < ApplicationController
42 42 return
43 43 end
44 44  
45   - if @user.update_attributes(params[:user])
  45 + if @user.update_attributes(password_attributes)
46 46 flash[:notice] = "Password was successfully updated. Please login with it"
47 47 redirect_to new_user_session_path
48 48 else
... ...