Task part for i18n_variable removal for web_resource

This commit is contained in:
Christophe Vilayphiou 2012-07-26 04:37:40 +08:00
parent a1cf0a3eb6
commit 94337a58d5
1 changed files with 14 additions and 0 deletions

View File

@ -173,6 +173,20 @@ namespace :migrate do
end
p 'End WebLink'
p '====================================================='
p 'Start WebLinkCategory'
categories = WebLinkCategory.admin_manager_all
i = 1
categories.each do |category|
p "#{i}/#{categories.size} - #{category.id}"
title = I18nVariable.first(:conditions => {:language_value_id => category.id, :language_value_type => category.class})
category.title_translations = {'en' => title['en'], 'zh_tw' => title['zh_tw']} if title
category.save(:validate => false)
i += 1
end
p 'End WebLinkCategory'
end
end