Orbit/app/models/desktop/section.rb

17 lines
274 B
Ruby
Raw Normal View History

2012-04-03 10:25:41 +00:00
class Section
include Mongoid::Document
include Mongoid::Timestamps
2012-04-05 12:32:56 +00:00
field :name
2012-04-03 10:25:41 +00:00
belongs_to :desktop
has_many :groups, :autosave => true, :dependent => :destroy
before_create :initialize_group
def initialize_group
2012-04-05 12:32:56 +00:00
self.groups.build
2012-04-03 10:25:41 +00:00
end
2012-12-04 09:45:40 +00:00
end