personal-journal/app/models/journal_level.rb

18 lines
344 B
Ruby
Raw Normal View History

2014-06-12 10:27:26 +00:00
class JournalLevel
include Mongoid::Document
include Mongoid::Timestamps
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