orbit-basic/lib/tasks/designs.rake

12 lines
328 B
Ruby
Raw Permalink Normal View History

2012-05-14 00:59:53 +00:00
# encoding: utf-8
namespace :designs do
task :change_to, [:design_id] => [:environment] do |t, args|
2012-05-14 01:30:49 +00:00
design = Design.find(args[:design_id])
theme_id = design.themes.first.id
2012-05-14 00:59:53 +00:00
Page.all.each do |page|
2012-05-14 01:30:49 +00:00
page.update_attributes({design_id: args[:design_id], theme_id: (theme_id unless page.root?)})
2012-05-14 00:59:53 +00:00
end
end
end