fix error
This commit is contained in:
parent
ac2c08767f
commit
0474d206f6
|
@ -30,9 +30,9 @@ class AdImage
|
|||
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)}
|
||||
scope :is_expired, ->{self.and(AdImage.or({:deadline.lte=>Time.now}).selector)}
|
||||
scope :not_expired, ->{self.and(AdImage.or({:deadline.gte=>Time.now},{:deadline=>nil}).selector)}
|
||||
scope :can_display, ->{self.and(AdImage.unscoped.or({:postdate.lte=>Time.now},{:postdate=>nil}).selector,AdImage.unscoped.or({:deadline.gte=>Time.now},{:deadline=>nil}).selector)}
|
||||
scope :is_expired, ->{self.and(AdImage.unscoped.or({:deadline.lte=>Time.now}).selector)}
|
||||
scope :not_expired, ->{self.and(AdImage.unscoped.or({:deadline.gte=>Time.now},{:deadline=>nil}).selector)}
|
||||
|
||||
after_save do
|
||||
if (self.video_file_changed? || self.auto_convert_video_changed?) && self.auto_convert_video
|
||||
|
|
Loading…
Reference in New Issue