orbit-4-2/lib/tasks/designs.rake

12 lines
328 B
Ruby

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