Fix migration bug

This commit is contained in:
Christophe Vilayphiou 2012-09-11 16:32:20 +08:00
parent 73e48aebc6
commit 0a3a140b18
1 changed files with 1 additions and 1 deletions

View File

@ -362,7 +362,7 @@ namespace :migrate do
i = 1
news_bulletins.each do |news|
p "#{i}/#{news_bulletins.size} - #{news.id}"
news.subtitle.gsub!(/^\<p\>/, '').gsub!(/\<\/p\>$/, '') rescue nil
news.subtitle_translations = {'en' => (news.subtitle_translations['en'].gsub(/^\<p\>/, '').gsub(/\<\/p\>$/, '') rescue ''), 'zh_tw' => (news.subtitle_translations['zh_tw'].gsub(/^\<p\>/, '').gsub(/\<\/p\>$/, '') rescue nil)}
p news.save(:validate => false) if news.changed?
i += 1
end if news_bulletins