From dbb5d38dba86f0b7e1adb8e4c05d4403a9a979c9 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 10 Mar 2020 00:47:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/course_video.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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