From 327996a7b089fcd74a7ad800c131a981bff729f4 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Thu, 26 Jul 2012 04:37:40 +0800 Subject: [PATCH] Task part for i18n_variable removal for web_resource --- lib/tasks/migrate.rake | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/tasks/migrate.rake b/lib/tasks/migrate.rake index b9cbb605..b6781500 100644 --- a/lib/tasks/migrate.rake +++ b/lib/tasks/migrate.rake @@ -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