digital-archive/app/models/digital_content_archive_fil...

19 lines
447 B
Ruby
Raw Normal View History

2015-08-11 08:39:31 +00:00
# encoding: utf-8
class DigitalContentArchiveFile
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 :digital_content_archive
end