orbit-basic/app/models/ad_image.rb

30 lines
529 B
Ruby
Raw Normal View History

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 :link_open
2012-01-31 10:31:31 +00:00
field :to_save, :type => Boolean
field :to_destroy, :type => Boolean
LINK_OPEN_TYPES = ["new_window","local"]
2012-01-31 10:31:31 +00:00
embedded_in :ad_banner
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