personal-journal1/app/models/journal_level.rb

21 lines
424 B
Ruby
Raw Normal View History

2014-06-12 10:27:26 +00:00
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