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
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