fixed 精选项目不包含私有仓库

This commit is contained in:
“xxq250” 2022-07-28 17:31:07 +08:00
parent 99850e45ad
commit 27fae8d27b
1 changed files with 5 additions and 2 deletions

View File

@ -1,7 +1,10 @@
class Users::IsPinnedProjectsController < Users::BaseController
before_action :private_user_resources!, only: [:pin]
def index
@is_pinned_projects = observed_user.pinned_projects.order(position: :desc, created_at: :asc).includes(project: [:project_category, :project_language, :repository]).order(position: :desc)
def index
@is_pinned_projects = observed_user.pinned_projects.left_joins(:project)
.where("projects.is_public = TRUE")
.order(position: :desc, created_at: :asc)
.includes(project: [:project_category, :project_language, :repository]).order(position: :desc)
@is_pinned_projects = kaminari_paginate(@is_pinned_projects)
end