3 class User < ActiveRecord::Base
7 write_attribute("pass_crypt", Digest::MD5.hexdigest(str))
11 return self.pass_crypt
14 def self.authenticate(username, passwd)
15 find_first([ "display_name = ? AND pass_crypt =?",
17 Digest::MD5.hexdigest(passwd) ])