# encoding: utf-8

class WritingSeminarCategory
  include Mongoid::Document
  include Mongoid::Timestamps
  include OrbitCoreLib::ObjectAuthable
  include OrbitCoreLib::ObjectDisable
  # include Mongoid::MultiParameterAttributes
  AfterObjectAuthUrl = '/panel/personal_seminar/back_end/writing_seminar_categorys'
  APP_NAME = 'writing_seminar'
  # ObjectAuthTitlesOptions = %W{edit}
  ObjectAuthTitlesOptions = %W{submit_new fact_check}

  field :key
  
  has_many :writing_seminars
  
  def pp_object
    title
  end
  
  def self.from_id(id)
    WritingSeminarCategory.find(id) rescue nil
  end

  def self.is_localized?(field_name)
	self.fields[field_name.to_s].localized?
  end
  
end