##// END OF EJS Templates
only active users are now proposed when adding a member to a project...
Jean-Philippe Lang -
r187:5f361e71df2d
parent child
Show More
@@ -92,7 +92,7 class ProjectsController < ApplicationController
92 92 @issue_category ||= IssueCategory.new
93 93 @member ||= @project.members.new
94 94 @roles = Role.find(:all)
95 @users = User.find(:all) - @project.members.find(:all, :include => :user).collect{|m| m.user }
95 @users = User.find_active(:all) - @project.users
96 96 @custom_values ||= ProjectCustomField.find(:all).collect { |x| @project.custom_values.find_by_custom_field_id(x.id) || CustomValue.new(:custom_field => x) }
97 97 end
98 98
@@ -49,7 +49,19 class User < ActiveRecord::Base
49 49 # update hashed_password if password was set
50 50 self.hashed_password = User.hash_password(self.password) if self.password
51 51 end
52
52
53 def self.active
54 with_scope :find => { :conditions => [ "status = ?", STATUS_ACTIVE ] } do
55 yield
56 end
57 end
58
59 def self.find_active(*args)
60 active do
61 find(*args)
62 end
63 end
64
53 65 # Returns the user that matches provided login and password, or nil
54 66 def self.try_to_login(login, password)
55 67 user = find(:first, :conditions => ["login=?", login])
General Comments 0
You need to be logged in to leave comments. Login now