orbit-basic/app/models/desktop.rb

16 lines
302 B
Ruby
Raw Normal View History

2012-04-03 10:25:41 +00:00
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