From 27fae8d27becf679960a9a3a11c00fad980c56c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cxxq250=E2=80=9D?= <“xxq250@qq.com”> Date: Thu, 28 Jul 2022 17:31:07 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=E7=B2=BE=E9=80=89=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E4=B8=8D=E5=8C=85=E5=90=AB=E7=A7=81=E6=9C=89=E4=BB=93=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users/is_pinned_projects_controller.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/controllers/users/is_pinned_projects_controller.rb b/app/controllers/users/is_pinned_projects_controller.rb index 1ddadd277..ff45120fb 100644 --- a/app/controllers/users/is_pinned_projects_controller.rb +++ b/app/controllers/users/is_pinned_projects_controller.rb @@ -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