orbit-basic/app/models/group.rb

15 lines
270 B
Ruby

class Group
include Mongoid::Document
include Mongoid::Timestamps
belongs_to :section
has_many :tiles, :autosave => true, :dependent => :destroy
before_create :initialize_tile
def initialize_tile
self.tiles.build
self.tiles.build
end
end