diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index fa4648852..15e795bdb 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -330,7 +330,7 @@ class ApplicationController < ActionController::Base end if !User.current.logged? && Rails.env.development? - User.current = User.find 3117 + User.current = User.find 1 end diff --git a/app/models/course_video.rb b/app/models/course_video.rb index 246be34fd..eb2a17595 100644 --- a/app/models/course_video.rb +++ b/app/models/course_video.rb @@ -4,4 +4,5 @@ class CourseVideo < ApplicationRecord belongs_to :user, optional: true validates :title, length: { maximum: 60, too_long: "不能超过60个字符" } + validates :link, format: { with: CustomRegexp::URL, message: "必须为网址超链接" } end