# encoding: utf-8

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

  ObjectAuthTitlesOptions = %W{submit_new fact_check}
  AfterObjectAuthUrl = '/panel/news/back_end/news_bulletin_categorys'
  # include Mongoid::MultiParameterAttributes
  
  PAYMENT_TYPES = [ "List", "Picture" ]
  APP_NAME = 'news'

  field :key
  field :display
  
  has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy
  has_many :news_bulletins
  
  def pp_object
    i18n_variable[I18n.locale]
  end
  
  def self.from_id(id)
    NewsBulletinCategory.find(id) rescue nil
  end
  
end