diff options
-rw-r--r-- | app/models/project.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index bf83c1389..d1504ab80 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.empty? + 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] |