property/app/models/property_item_file.rb

19 lines
428 B
Ruby
Raw Permalink Normal View History

2015-08-11 08:45:03 +00:00
# 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