personal-journal/app/models/journal_level.rb

21 lines
424 B
Ruby

class JournalLevel
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::Attributes::Dynamic
include OrbitCoreLib::ObjectDisable
field :key, type: String
field :title, type: String, localize: true
has_and_belongs_to_many :journal_papers
def self.from_id(id)
self.find(id) rescue nil
end
def self.is_localized?(field_name)
self.fields[field_name.to_s].localized?
end
end