管理员查看user_projects 课程项目混淆的问题

This commit is contained in:
yanxd 2014-05-28 11:47:50 +08:00
parent 31804b3d45
commit 5d8edb218f
1 changed files with 1 additions and 1 deletions

View File

@ -65,7 +65,7 @@ class UsersController < ApplicationController
def user_projects
if User.current.admin?
@memberships = @user.memberships.all
@memberships = @user.memberships.all(conditions: "projects.project_type = #{Project::ProjectType_project}")
else
cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1"
@memberships = @user.memberships.all(:conditions => cond)