Failing to change user password in Rails console
When trying to change a Devise user password manually in the Rails console, if user.save always returns false:
user = User.where(email:'me@example.com').first
user.password = 'pass'
user.password_confirmation = 'pass'
user.save
=> false
The problem might be that your password is too short! :-) Check user.errors for details of the issue.
Written by Kenneth Falck
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#