# encoding: utf-8

class ArchiveFileCategory
  include Mongoid::Document
  include Mongoid::Timestamps
  include OrbitCoreLib::ObjectAuthable
  include OrbitCoreLib::ObjectDisable 
  
  APP_NAME = 'Archive'
  ObjectAuthTitlesOptions = %W{submit_new fact_check}
  AfterObjectAuthUrl = '/panel/archive/back_end/archive_file_categorys'
  
  field :disable, type: Boolean, :default => false
  field :display
  field :key  
  field :title, localize: true
  
  has_many :archive_files

  validates :title, :at_least_one => true


  def pp_object
    title
  end

  def self.from_id(id)
    ArchiveFileCategory.find(id) rescue nil
  end
  
end