# encoding: utf-8

class ProjectCategory
  include Mongoid::Document
  include Mongoid::Timestamps
  include OrbitCoreLib::ObjectAuthable
  include OrbitCoreLib::ObjectDisable
  # include Mongoid::MultiParameterAttributes
  AfterObjectAuthUrl = '/panel/personal_project/back_end/project_categorys'
  APP_NAME = 'project'
  # ObjectAuthTitlesOptions = %W{edit}
  ObjectAuthTitlesOptions = %W{submit_new fact_check}

  field :key
  
  field :title, localize: true
  
  has_many :projects
  
  def pp_object
    title
  end
  
  def self.from_id(id)
    ProjectCategory.find(id) rescue nil
  end
  
end