# 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