@@ -77,7 +77,7 class Project < ActiveRecord::Base | |||
|
77 | 77 | def self.visible_by(user=nil) |
|
78 | 78 | if user && user.admin? |
|
79 | 79 | return ["#{Project.table_name}.status=#{Project::STATUS_ACTIVE}"] |
|
80 |
elsif user && |
|
|
80 | elsif user && user.memberships.any? | |
|
81 | 81 | 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] |
|
82 | 82 | else |
|
83 | 83 | return ["#{Project.table_name}.status=#{Project::STATUS_ACTIVE} AND #{Project.table_name}.is_public = ?", true] |
General Comments 0
You need to be logged in to leave comments.
Login now