Fix migration bug
This commit is contained in:
parent
73e48aebc6
commit
0a3a140b18
|
@ -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
|
||||
|
|
Reference in New Issue