From b3a2d0725730c835eb96fdfb649e9cda1eb7db8f Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 3 Feb 2013 08:23:20 +0000 Subject: [PATCH] Code cleanup. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11313 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index ec3cc3fc5..e97d01a7c 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -444,7 +444,7 @@ class User < Principal # Return true if the user is a member of project def member_of?(project) - !roles_for_project(project).detect {|role| role.member?}.nil? + roles_for_project(project).any? {|role| role.member?} end # Returns a hash of user's projects grouped by roles -- 2.39.5