2012-04-03 10:25:41 +00:00
|
|
|
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
|
2012-04-11 07:31:10 +00:00
|
|
|
self.tiles.build(data_category: "widget", data_content: "timetable", position: 1, shape: "w2 h2", title: "Tiime Table")
|
|
|
|
self.tiles.build(data_category: "app", data_content: "quotes", position: 2, shape: "w1 h1", title: "Quotes")
|
|
|
|
self.tiles.build(data_category: "widget", data_content: "weather", position: 3, shape: "w2 h2", title: "Weather")
|
|
|
|
self.tiles.build(data_category: "widget", data_content: "clock", position: 4, shape: "w2 h1", title: "Clock")
|
|
|
|
self.tiles.build(data_category: "app", data_content: "dailyenglish", position: 5, shape: "w1 h1", title: "Daily English Word")
|
|
|
|
self.tiles.build(data_category: "widget", data_content: "school_events", position: 6, shape: "w2 h1", title: "School Events")
|
2012-04-03 10:25:41 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|