|
|
|
@ -114,9 +114,10 @@ class CoursesController < ApplicationController
|
|
|
|
|
@count = videos.count
|
|
|
|
|
#sql = "left join videos on videos.id=course_videos.video_id AND (videos.transcoded=1 OR videos.user_id = #{current_user.id})"
|
|
|
|
|
#@videos = paginate videos.joins(sql).includes(video: [user: :user_extension], user: :user_extension)
|
|
|
|
|
@videos = paginate videos.includes(:video)
|
|
|
|
|
.where(video: {transcoded: true}).or(video: {user_id: current_user.id})
|
|
|
|
|
.or(video: {is_link: true})
|
|
|
|
|
videos = videos.includes(video: [user: :user_extension], user: :user_extension)
|
|
|
|
|
@videos = paginate videos.where(video: {transcoded: true})
|
|
|
|
|
.or(videos.where(video: {user_id: current_user.id}))
|
|
|
|
|
.or(videos.where(course_videos: {is_link: true}))
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def delete_course_video
|
|
|
|
|