diff --git a/app/models/course_video.rb b/app/models/course_video.rb index eb2a17595..2cfa151ce 100644 --- a/app/models/course_video.rb +++ b/app/models/course_video.rb @@ -3,6 +3,6 @@ class CourseVideo < ApplicationRecord belongs_to :video, optional: true belongs_to :user, optional: true - validates :title, length: { maximum: 60, too_long: "不能超过60个字符" } - validates :link, format: { with: CustomRegexp::URL, message: "必须为网址超链接" } + validates :title, length: { maximum: 60, too_long: "不能超过60个字符" }, allow_blank: true + validates :link, format: { with: CustomRegexp::URL, message: "必须为网址超链接" }, allow_blank: true end