I have this method in user.rb that automatically converts password to
SHA1 hash
def password=(value)
write_attribute("password", Digest::SHA1.hexdigest(value))
end
but my user model validations dont seem to work properly..for example
length_of and confirmation_of.. cause it gets SHA1 and stuff..
how do I keep it encrypted yet keep validations too?
if I remove the above mentioned method, it works fine but I risk the
password being naked :/
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---