fix error

This commit is contained in:
邱博亞 2022-01-24 09:46:10 +08:00
parent ada0c0642d
commit c4246c84be
1 changed files with 1 additions and 1 deletions

View File

@ -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)}