orbit4-5/app/models/personal_plugin_intro.rb

24 lines
488 B
Ruby
Raw Normal View History

2014-06-25 13:40:13 +00:00
class PersonalPluginIntro
include Mongoid::Document
include Mongoid::Timestamps
field :text, type: String, localize: true
field :brief_intro, type: Mongoid::Boolean, default: false
field :complete_list, type: Mongoid::Boolean, default: true
belongs_to :member_profile
def pp_object
brief_intro
end
def self.from_id(id)
PersonalPluginIntro.find(id) rescue nil
end
def self.is_localized?(field_name)
self.fields[field_name.to_s].localized?
end
end