From 0a3a140b1898d4f6d7042041eb631a0ea10df395 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Tue, 11 Sep 2012 16:32:20 +0800 Subject: [PATCH] Fix migration bug --- lib/tasks/migrate.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/migrate.rake b/lib/tasks/migrate.rake index 77a200b80..74f8df8ce 100644 --- a/lib/tasks/migrate.rake +++ b/lib/tasks/migrate.rake @@ -362,7 +362,7 @@ namespace :migrate do i = 1 news_bulletins.each do |news| p "#{i}/#{news_bulletins.size} - #{news.id}" - news.subtitle.gsub!(/^\/, '').gsub!(/\<\/p\>$/, '') rescue nil + news.subtitle_translations = {'en' => (news.subtitle_translations['en'].gsub(/^\/, '').gsub(/\<\/p\>$/, '') rescue ''), 'zh_tw' => (news.subtitle_translations['zh_tw'].gsub(/^\/, '').gsub(/\<\/p\>$/, '') rescue nil)} p news.save(:validate => false) if news.changed? i += 1 end if news_bulletins