From 7105f103e1c9f6af17aab0bfee5cc71d1595bf5a Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 5 Feb 2013 12:27:23 +0800 Subject: [PATCH] Task to delete settings for old version of default widget --- lib/tasks/migrate.rake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/tasks/migrate.rake b/lib/tasks/migrate.rake index f3b16f16..0c7d6148 100644 --- a/lib/tasks/migrate.rake +++ b/lib/tasks/migrate.rake @@ -492,4 +492,10 @@ namespace :migrate do pp.save end end + + task :clean_parts => :environment do + PagePart.where(widget_style: /\d/, kind: 'module_widget').each{|part| part.update_attributes({kind: 'text', widget_style: nil, widget_field: nil})} + PagePart.where(widget_style: /\d/).each{|part| part.update_attributes({widget_style: nil, widget_field: nil})} + end + end