# encoding: utf-8

class BulletinCategory
  include Mongoid::Document
  include Mongoid::Timestamps
  include OrbitCoreLib::ObjectAuthable
  
  ObjectAuthTitlesOptions = %W{submit_new fact_check}
  AfterObjectAuthUrl = '/panel/announcement/back_end/bulletin_categorys'
  # include Mongoid::MultiParameterAttributes
  
  PAYMENT_TYPES = [ "List", "Picture" ]
  APP_NAME = 'Announcement'
  field :key
  field :display
  
  has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy
  
  has_many :bulletins
  
  def pp_object
    i18n_variable[I18n.locale]
  end
  
  def self.from_id(id)
    BulletinCategory.find(id) rescue nil
  end
  
end