event_ann/app/models/bulletin_event_file.rb

25 lines
434 B
Ruby

# encoding: utf-8
class BulletinEventFile
include Mongoid::Document
include Mongoid::Timestamps
mount_uploader :file, AssetUploader
field :description, localize: true
field :title, localize: true
field :choose_lang, :type => Array, :default => ["en","zh_tw"]
belongs_to :bulletin_event
def enabled_for?(lang)
if lang.nil?
return true
else
return self.choose_lang.include?(lang)
end
end
end