Fixed User role_for_project method

git-svn-id: http://redmine.rubyforge.org/svn/trunk@416 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2007-04-04 17:46:51 +00:00
parent 8e6d575d4e
commit 4ed89dc2d3
1 changed files with 2 additions and 1 deletions

View File

@ -125,7 +125,8 @@ class User < ActiveRecord::Base
end end
def role_for_project(project) def role_for_project(project)
memberships.detect {|m| m.project_id == project.id} member = memberships.detect {|m| m.project_id == project.id}
member ? member.role : nil
end end
def pref def pref