From f0dd1eb8713e9daf22211a68d1484bd4eff966c2 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Mon, 14 May 2012 09:30:49 +0800 Subject: [PATCH] Fix designs.rake --- lib/tasks/designs.rake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/tasks/designs.rake b/lib/tasks/designs.rake index e59f263a..c8940e22 100644 --- a/lib/tasks/designs.rake +++ b/lib/tasks/designs.rake @@ -2,9 +2,10 @@ namespace :designs do task :change_to, [:design_id] => [:environment] do |t, args| - # design = Design.find(args[:design_id]) + design = Design.find(args[:design_id]) + theme_id = design.themes.first.id Page.all.each do |page| - page.update_attribute('design_id', args[:design_id]) + page.update_attributes({design_id: args[:design_id], theme_id: (theme_id unless page.root?)}) end end