@@ -92,7 +92,7 class ProjectsController < ApplicationController | |||||
92 | @issue_category ||= IssueCategory.new |
|
92 | @issue_category ||= IssueCategory.new | |
93 | @member ||= @project.members.new |
|
93 | @member ||= @project.members.new | |
94 | @roles = Role.find(:all) |
|
94 | @roles = Role.find(:all) | |
95 |
@users = User.find(:all) - @project. |
|
95 | @users = User.find_active(:all) - @project.users | |
96 | @custom_values ||= ProjectCustomField.find(:all).collect { |x| @project.custom_values.find_by_custom_field_id(x.id) || CustomValue.new(:custom_field => x) } |
|
96 | @custom_values ||= ProjectCustomField.find(:all).collect { |x| @project.custom_values.find_by_custom_field_id(x.id) || CustomValue.new(:custom_field => x) } | |
97 | end |
|
97 | end | |
98 |
|
98 |
@@ -50,6 +50,18 class User < ActiveRecord::Base | |||||
50 | self.hashed_password = User.hash_password(self.password) if self.password |
|
50 | self.hashed_password = User.hash_password(self.password) if self.password | |
51 | end |
|
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 | # Returns the user that matches provided login and password, or nil |
|
65 | # Returns the user that matches provided login and password, or nil | |
54 | def self.try_to_login(login, password) |
|
66 | def self.try_to_login(login, password) | |
55 | user = find(:first, :conditions => ["login=?", login]) |
|
67 | user = find(:first, :conditions => ["login=?", login]) |
General Comments 0
You need to be logged in to leave comments.
Login now