-
-
Save steverob/9685276 to your computer and use it in GitHub Desktop.
Revisions
-
moeffju created this gist
Jan 30, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ class User < ActiveRecord::Base alias :devise_valid_password? :valid_password? def valid_password?(password) begin devise_valid_password?(password) rescue BCrypt::Errors::InvalidHash return false unless Digest::SHA1.hexdigest(password) == encrypted_password logger.info "User #{email} is using the old password hashing method, updating attribute." self.password = password true end end end