附件的资源外链增加判断

courseware
cxt 5 years ago
parent 5e468dfc03
commit d071b7d159

@ -28,6 +28,7 @@ class Attachment < ApplicationRecord
scope :no_link, -> {where(link: nil)}
validates_length_of :description, maximum: 100, message: "不能超过100个字符"
validates :link, format: { with: CustomRegexp::URL, message: "必须为网址超链接" }, allow_blank: true
DCODES = %W(2 3 4 5 6 7 8 9 a b c f e f g h i j k l m n o p q r s t u v w x y z)

Loading…
Cancel
Save