From f501c98c60ac4f1faeaa25b29033b89e8a2eec90 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 8 Feb 2020 16:49:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E8=A7=86=E9=A2=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users/videos_controller.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/controllers/users/videos_controller.rb b/app/controllers/users/videos_controller.rb index b7ffe8035..0ae240dd7 100644 --- a/app/controllers/users/videos_controller.rb +++ b/app/controllers/users/videos_controller.rb @@ -57,6 +57,14 @@ class Users::VideosController < Users::BaseController def current_video @_current_video ||= observed_user.videos.find_by(id: params[:id]) + if @_current_video.nil? + video = Video.find_by(id: params[:id]) + if video.course_videos.present? + video + end + else + @_current_video + end end def search_params