2012-01-11 12:31:52 +00:00
|
|
|
# encoding: utf-8
|
|
|
|
|
|
|
|
class BulletinCategory
|
|
|
|
include Mongoid::Document
|
|
|
|
include Mongoid::Timestamps
|
2012-02-13 09:33:48 +00:00
|
|
|
include OrbitCoreLib::ObjectAuthable
|
2012-07-05 08:00:45 +00:00
|
|
|
include OrbitCoreLib::ObjectDisable
|
|
|
|
|
2012-02-17 09:50:23 +00:00
|
|
|
ObjectAuthTitlesOptions = %W{submit_new fact_check}
|
2012-02-15 10:20:44 +00:00
|
|
|
AfterObjectAuthUrl = '/panel/announcement/back_end/bulletin_categorys'
|
2012-01-12 10:38:50 +00:00
|
|
|
# include Mongoid::MultiParameterAttributes
|
2012-01-11 12:31:52 +00:00
|
|
|
|
2012-02-06 07:23:27 +00:00
|
|
|
PAYMENT_TYPES = [ "List", "Picture" ]
|
2012-05-14 04:34:15 +00:00
|
|
|
APP_NAME = 'Announcement'
|
2012-05-18 07:20:45 +00:00
|
|
|
|
2012-07-25 18:27:43 +00:00
|
|
|
field :disable, type: Boolean, :default => false
|
2012-02-06 07:23:27 +00:00
|
|
|
field :display
|
2012-07-25 18:27:43 +00:00
|
|
|
field :key
|
|
|
|
field :title, localize: true
|
2012-01-11 12:31:52 +00:00
|
|
|
|
2012-07-04 09:36:51 +00:00
|
|
|
has_many :bulletins
|
2012-01-11 12:31:52 +00:00
|
|
|
|
2012-05-11 08:44:40 +00:00
|
|
|
def pp_object
|
2012-07-25 19:29:06 +00:00
|
|
|
title
|
2012-05-11 08:44:40 +00:00
|
|
|
end
|
|
|
|
|
2012-02-29 08:01:50 +00:00
|
|
|
def self.from_id(id)
|
|
|
|
BulletinCategory.find(id) rescue nil
|
|
|
|
end
|
|
|
|
|
2012-05-18 07:20:45 +00:00
|
|
|
end
|