| Class | User |
| In: |
app/models/user.rb
|
| Parent: | ActiveRecord::Base |
| password | [RW] | has_and_belongs_to_many :roles |
Return the User with the given name and plain-text password
# File app/models/user.rb, line 30
30: def self.login(name, password)
31: hashed_password = hash_password(password || "")
32: find(:first,
33: :conditions => ["name = ? and hashed_password = ? and confirmed = 1",
34: name, hashed_password])
35: end
Clear out the plain-text password once we’ve saved this row. This stops it being made available in the session
# File app/models/user.rb, line 54
54: def after_create
55: @password = nil
56: end