19 lines
428 B
Ruby
19 lines
428 B
Ruby
|
# encoding: utf-8
|
||
|
class PropertyItemFile
|
||
|
include Mongoid::Document
|
||
|
include Mongoid::Timestamps
|
||
|
|
||
|
mount_uploader :file, AssetUploader
|
||
|
|
||
|
field :file_title,localize: true
|
||
|
field :download_count, type: Integer, default: 0
|
||
|
field :choose_lang, :type => Array, :default => ["en","zh_tw"]
|
||
|
|
||
|
field :should_destroy, :type => Boolean
|
||
|
|
||
|
def choose_lang_display(lang)
|
||
|
self.choose_lang.include?(lang)
|
||
|
end
|
||
|
|
||
|
belongs_to :property_item
|
||
|
end
|