2012-01-31 10:31:31 +00:00
|
|
|
class AdImage
|
|
|
|
include Mongoid::Document
|
|
|
|
include Mongoid::Timestamps
|
|
|
|
|
|
|
|
mount_uploader :file, ImageUploader
|
|
|
|
|
|
|
|
field :time_to_next #Weight
|
|
|
|
field :picture_intro
|
|
|
|
field :out_link
|
|
|
|
|
|
|
|
field :to_save, :type => Boolean
|
|
|
|
field :to_destroy, :type => Boolean
|
|
|
|
|
|
|
|
embedded_in :ad_banner
|
|
|
|
|
2012-02-03 06:28:08 +00:00
|
|
|
def get_delay_time
|
|
|
|
time = ''
|
|
|
|
if self.time_to_next.nil?
|
|
|
|
time = '1000'
|
|
|
|
else
|
|
|
|
time = (self.time_to_next.to_i * 1000).to_s
|
|
|
|
end
|
|
|
|
time
|
|
|
|
end
|
2012-01-31 10:31:31 +00:00
|
|
|
end
|