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

17 lines
274 B
Ruby

class Section
include Mongoid::Document
include Mongoid::Timestamps
field :name
belongs_to :desktop
has_many :groups, :autosave => true, :dependent => :destroy
before_create :initialize_group
def initialize_group
self.groups.build
end
end