Skip to content

Instantly share code, notes, and snippets.

@aalvesjr
Last active December 11, 2015 01:18
Show Gist options
  • Save aalvesjr/4522226 to your computer and use it in GitHub Desktop.
Save aalvesjr/4522226 to your computer and use it in GitHub Desktop.
Setter password de User
def password=(password)
# O ideal seria extrair o Digest::SHA1.hexdigest
# para uma classe responsavel por encriptar a senha
value = Digest::SHA1.hexdigest(password)
write_attribute(:password, value)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment