# encoding: utf-8

class WebLinkCategory
  include Mongoid::Document
  include Mongoid::Timestamps
  include OrbitCoreLib::ObjectAuthable
  include OrbitCoreLib::ObjectDisable
  # include Mongoid::MultiParameterAttributes
  AfterObjectAuthUrl = '/panel/page_content/back_end/page_contexts'
  APP_NAME = 'web_resource'
  ObjectAuthTitlesOptions = %W{edit}

  field :key
  
  field :title, localize: true
  
  has_many :web_links
  
  def pp_object
    title
  end

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

end