From c4246c84be13c87c8b29e450b55b340a9f53d063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Mon, 24 Jan 2022 09:46:10 +0800 Subject: [PATCH] fix error --- app/models/ad_image.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/ad_image.rb b/app/models/ad_image.rb index c30fb9b..041e304 100644 --- a/app/models/ad_image.rb +++ b/app/models/ad_image.rb @@ -27,7 +27,7 @@ class AdImage before_validation :add_http # validates :file, presence: true - validates :out_link, format: { with: URI::regexp(%w(http https)) }, allow_blank: true + validates :out_link, format: { with: URI::regexp(%w(http https \/)) }, allow_blank: true # validates :title, presence: true scope :can_display, ->{self.and(AdImage.or({:postdate.lte=>Time.now},{:postdate=>nil}).selector,AdImage.or({:deadline.gte=>Time.now},{:deadline=>nil}).selector)}