Task to delete settings for old version of default widget

This commit is contained in:
chris 2013-02-05 12:27:23 +08:00
parent e604c38eb4
commit 7105f103e1
1 changed files with 6 additions and 0 deletions

View File

@ -492,4 +492,10 @@ namespace :migrate do
pp.save pp.save
end end
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 end