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:
parent
13881f5a5b
commit
5f361e71df
|
@ -92,7 +92,7 @@ class ProjectsController < ApplicationController
|
|||
@issue_category ||= IssueCategory.new
|
||||
@member ||= @project.members.new
|
||||
@roles = Role.find(:all)
|
||||
@users = User.find(:all) - @project.members.find(:all, :include => :user).collect{|m| m.user }
|
||||
@users = User.find_active(:all) - @project.users
|
||||
@custom_values ||= ProjectCustomField.find(:all).collect { |x| @project.custom_values.find_by_custom_field_id(x.id) || CustomValue.new(:custom_field => x) }
|
||||
end
|
||||
|
||||
|
|
|
@ -50,6 +50,18 @@ class User < ActiveRecord::Base
|
|||
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])
|
||||
|
|
Loading…
Reference in New Issue