Help in understanding encrypting the password
Dhana Shunmu...
1 post
|
I am currently on page 183 on the pdf version and I am a little confused about this method. Looks like this is an instance method and not a class method, but why is the salt and encrypted_password need the self keyword in front of it. Would really appreciate it if someone could give me an idea what’s actually happening.
def encrypt_password
return if password.blank?
if new_record?
self.salt = Digest::SHA1.hexdigest("--#{Time.now}--#{email}--" )
end
self.encrypted_password = User.encrypt(password, salt)
end
|
Derek DeVries
18 posts
|
Dhana, The The difference is that in the case of The Here is an article that explains Hope this helps! |
2 posts, 2 voices
