orbit-basic/app/models/section.rb

16 lines
292 B
Ruby
Raw Normal View History

2012-04-03 10:25:41 +00:00
class Section
include Mongoid::Document
include Mongoid::Timestamps
field :name, default: "Section"
belongs_to :desktop
has_many :groups, :autosave => true, :dependent => :destroy
before_create :initialize_group
def initialize_group
self.build_group
end
end