19 lines
424 B
Ruby
19 lines
424 B
Ruby
|
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"]
|
||
|
|
||
|
belongs_to :ad_banner
|
||
|
|
||
|
validates :file, :presence => true
|
||
|
|
||
|
end
|