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:
parent
8e6d575d4e
commit
4ed89dc2d3
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue