orbit-personaljournal/app/models/writing_journal_category.rb

27 lines
618 B
Ruby
Raw Permalink Normal View History

2014-01-15 10:52:45 +00:00
class WritingJournalCategory
include Mongoid::Document
include Mongoid::Timestamps
include OrbitCoreLib::ObjectAuthable
include OrbitCoreLib::ObjectDisable
AfterObjectAuthUrl = '/panel/personal_journal/back_end/writing_journal_categorys'
APP_NAME = 'writing_journal'
# ObjectAuthTitlesOptions = %W{edit}
ObjectAuthTitlesOptions = %W{submit_new fact_check}
field :key
has_many :writing_journals
def pp_object
title
end
def self.from_id(id)
WritingJournalCategory.find(id) rescue nil
end
def self.is_localized?(field_name)
self.fields[field_name.to_s].localized?
end
end