From f092aff9e98fe32083c8b2439913685681c2be3d Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Wed, 1 Aug 2012 02:43:06 +0800 Subject: [PATCH] Fix for data_migration but there's still a bug with red is, the red is code has to be commented out to run the rake task --- lib/tasks/data_migration.rake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/tasks/data_migration.rake b/lib/tasks/data_migration.rake index 1a992126c..cba9a1c6f 100644 --- a/lib/tasks/data_migration.rake +++ b/lib/tasks/data_migration.rake @@ -46,19 +46,22 @@ namespace :data_migration do task :make_bulletins_and_news_has_language_flag => :environment do a = [] + i = 0 [Bulletin,NewsBulletin].each do |bulletin| puts "="*10 + bulletin.to_s + "="*10 - bulletin.all.each do |bt| + bulletin.admin_manager_all.each do |bt| result = if (bt.save(:validate => false) rescue false ) "OK" else - 'Failed' a << bt.id + 'Failed' end + i += 1 puts((bt.title.to_s rescue '') + "----------#{result}") end end p a + p i puts("#{'='*10}Finished#{'='*10}") end