This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/app/models/user/personal_plugin_intro.rb

28 lines
581 B
Ruby
Raw Normal View History

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