From 2416030adcc2ace4b26f9ccc960896810956bcca Mon Sep 17 00:00:00 2001 From: "Matt K. Fu" Date: Wed, 10 Apr 2013 17:58:31 +0800 Subject: [PATCH] remove useless rake task --- lib/tasks/desktop.rake | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/lib/tasks/desktop.rake b/lib/tasks/desktop.rake index ffe7a574..8d04ad5d 100644 --- a/lib/tasks/desktop.rake +++ b/lib/tasks/desktop.rake @@ -62,15 +62,28 @@ namespace :desktop do temp_file end - task :destroy_build_desktop => :environment do - Desktop.all.destroy_all - u = User.all - u.each do |us| - Thread.new { - us.initialize_desktop.save! - puts "Desktop created for " + us.email.to_s - }.join - end +end + +namespace :tiles do + task :destroy_build_tiles => :environment do + Tile.destroy_all + secs = Section.all + dws = DesktopWidget.all + secs.each do |sec,x| + grp = sec.groups.first + t = Tile.new(data_category: "app", data_content: "wikibooks", position: 1, shape: "w1 h1", title: "WikiBooks") + grp.tiles+=[t] + t = Tile.new(data_category: "app", data_content: "envocab", position: 2, shape: "w1 h1", title: "English Vocabulary") + grp.tiles+=[t] + @i = 3 + dws.each do |dw| + t = Tile.new(data_category: "widget", position: @i,desktop_widget_id: dw.id) + @i = @i + 1 + grp.tiles+=[t] + end + grp.save! + puts "Section " + (x || "NilString") + " done!" + end end -end \ No newline at end of file +end