orbit-4-2/app/models/user/personal_plugin_intro.rb

28 lines
581 B
Ruby

class PersonalPluginIntro
include Mongoid::Document
include Mongoid::Timestamps
# include OrbitCoreLib::ObjectAuthable
# include OrbitCoreLib::ObjectDisable
# has_and_belongs_to_many :users
belongs_to :user
field :text, localize: true
field :brief_intro, :type => Boolean, :default => false
field :complete_list, :type => Boolean, :default => true
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