From 4ed89dc2d372ed34d2154f81f71b2a4632b3915e Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 4 Apr 2007 17:46:51 +0000 Subject: [PATCH] Fixed User role_for_project method git-svn-id: http://redmine.rubyforge.org/svn/trunk@416 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/user.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index 15f857542..514517de6 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -125,7 +125,8 @@ class User < ActiveRecord::Base end 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 def pref