only active users are now proposed when adding a member to a project

git-svn-id: http://redmine.rubyforge.org/svn/trunk@190 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2007-01-26 20:52:52 +00:00
parent 13881f5a5b
commit 5f361e71df
2 changed files with 14 additions and 2 deletions
+13 -1
View File
@@ -49,7 +49,19 @@ class User < ActiveRecord::Base
# update hashed_password if password was set
self.hashed_password = User.hash_password(self.password) if self.password
end
def self.active
with_scope :find => { :conditions => [ "status = ?", STATUS_ACTIVE ] } do
yield
end
end
def self.find_active(*args)
active do
find(*args)
end
end
# Returns the user that matches provided login and password, or nil
def self.try_to_login(login, password)
user = find(:first, :conditions => ["login=?", login])