forked from saurabh/personal-journal
18 lines
344 B
Ruby
18 lines
344 B
Ruby
|
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
|