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/desktop.rb

16 lines
302 B
Ruby

class Desktop
include Mongoid::Document
include Mongoid::Timestamps
field :theme, default: "default"
belongs_to :user
has_many :sections, :autosave => true, :dependent => :destroy
before_create :initialize_section
def initialize_section
user.self.build_section
end
end