DatabaseAuthenticatable#clean_up_passwords should set accessors to nil #1313

Merged
merged 1 commit into from Sep 2, 2011

Conversation

Projects
None yet
2 participants
Contributor

jamescook commented Sep 2, 2011

clean_up_passwords is setting password/password_confirmation to an empty string (despite what the comment says).

In my app, this causes update_with_password to fail on a second attempt with the validation error "password can't be blank"

e.g.

u = User.first
u.update_with_password(:current_password => "password", :first_name => "Bob")
 => true

u.update_with_password(:current_password => "password", :first_name => "Bob")
=> false
u.errors
=> {:password=>["can't be blank"]}

@josevalim josevalim added a commit that referenced this pull request Sep 2, 2011

@josevalim josevalim Merge pull request #1313 from jamescook/fix_bug_with_update_with_pass…
…word

DatabaseAuthenticatable#clean_up_passwords should set accessors to nil
1b5d0af

@josevalim josevalim merged commit 1b5d0af into plataformatec:master Sep 2, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment