orbit-basic/vendor/built_in_modules/announcement/app/models/bulletin_category.rb

32 lines
675 B
Ruby
Raw Normal View History

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
ObjectAuthTitlesOptions = %W{submit_new fact_check}
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" ]
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
def pp_object
title
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