diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-03-28 12:07:05 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-03-28 12:07:05 +0000 |
commit | 04e181b8b05d00a95d49aea0435f8542914b0fbc (patch) | |
tree | ebd9c00a13a4655b33df9a0d94bbae0272116954 /app/models/member.rb | |
parent | b4be8849c0de81841c458c0f059787a9cc9bc022 (diff) | |
download | redmine-04e181b8b05d00a95d49aea0435f8542914b0fbc.tar.gz redmine-04e181b8b05d00a95d49aea0435f8542914b0fbc.zip |
Adds a user search field with autocompleter on project members screen.
User selection with checkboxes is disabled if there are more than 300 users available (#2993).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2638 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/member.rb')
-rw-r--r-- | app/models/member.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/member.rb b/app/models/member.rb index 0f644dbe7..5228d1ffc 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -31,6 +31,16 @@ class Member < ActiveRecord::Base self.user.name end + # Sets user by login + def user_login=(login) + login = login.to_s + unless login.blank? + if (u = User.find_by_login(login)) + self.user = u + end + end + end + def <=>(member) role == member.role ? (user <=> member.user) : (role <=> member.role) end |