summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-06-23 16:36:01 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-06-23 16:36:01 +0000
commitec44c94c12ca7c2dc143c396b6e605297e8ad4bf (patch)
treea687387b0552ed8dfb514a4ec8b009e18263a434
parent48c2a690c292e5470b5a8ab7d82d56f9d58fed15 (diff)
downloadredmine-ec44c94c12ca7c2dc143c396b6e605297e8ad4bf.tar.gz
redmine-ec44c94c12ca7c2dc143c396b6e605297e8ad4bf.zip
Fixed an error on welcome screen for users with no membership
git-svn-id: http://redmine.rubyforge.org/svn/trunk@569 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/models/project.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index d1504ab80..2cdf14b28 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -77,7 +77,7 @@ class Project < ActiveRecord::Base
def self.visible_by(user=nil)
if user && user.admin?
return ["#{Project.table_name}.status=#{Project::STATUS_ACTIVE}"]
- elsif user && !user.memberships.any?
+ elsif user && user.memberships.any?
return ["#{Project.table_name}.status=#{Project::STATUS_ACTIVE} AND (#{Project.table_name}.is_public = ? or #{Project.table_name}.id IN (#{user.memberships.collect{|m| m.project_id}.join(',')}))", true]
else
return ["#{Project.table_name}.status=#{Project::STATUS_ACTIVE} AND #{Project.table_name}.is_public = ?", true]