orbit-4-2/app/models/desktop/section.rb

17 lines
274 B
Ruby
Raw Permalink Normal View History

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