fix error
This commit is contained in:
parent
c4246c84be
commit
6d3683a98f
|
@ -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=> /\A(http:\/\/|https:\/\/|\/)/i}, 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)}
|
||||
|
|
Loading…
Reference in New Issue