class WritingJournalCategory
  include Mongoid::Document
  include Mongoid::Timestamps
  include OrbitCoreLib::ObjectAuthable
  include OrbitCoreLib::ObjectDisable

  AfterObjectAuthUrl = '/panel/personal_journal/back_end/writing_journal_categorys'
  APP_NAME = 'writing_journal'
  # ObjectAuthTitlesOptions = %W{edit}
  ObjectAuthTitlesOptions = %W{submit_new fact_check}

  field :key
  has_many :writing_journals

  def pp_object
    title
  end

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

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