adbanner-test/app/models/ad_image.rb

19 lines
421 B
Ruby
Raw Normal View History

2014-04-11 07:47:33 +00:00
class AdImage
include Mongoid::Document
include Mongoid::Timestamps
mount_uploader :file, ImageUploader
field :title, type: String, localize: true
field :context, type: String, localize: true
field :weight, type: Integer, default: 1
field :out_link, type: String
field :link_open, type: String
LINK_OPEN_TYPES = ["local", "new_window"]
2014-04-11 08:26:34 +00:00
belongs_to :banner
2014-04-11 07:47:33 +00:00
validates :file, :presence => true
end