Skip to content

Instantly share code, notes, and snippets.

@lucascaton
Created May 6, 2011 17:46
Show Gist options
  • Save lucascaton/959415 to your computer and use it in GitHub Desktop.
Save lucascaton/959415 to your computer and use it in GitHub Desktop.
Task.all.each do |t|
puts "Processing task [#{t.id}]"
t.title = t.title.gsub(/ã/, 'ã').gsub(/á/, 'á').gsub(/ê/, 'ê').gsub(/é/, 'é').gsub(/à /, 'í').gsub(/ó/, 'ó').gsub(/õ/, 'õ').gsub(/ú/, 'ú').gsub(/ç/, 'ç').gsub(/Ã/, 'à')
t.description = t.description.gsub(/ã/, 'ã').gsub(/á/, 'á').gsub(/ê/, 'ê').gsub(/é/, 'é').gsub(/à /, 'í').gsub(/ó/, 'ó').gsub(/õ/, 'õ').gsub(/ú/, 'ú').gsub(/ç/, 'ç').gsub(/Ã/, 'à')
t.save
end
FieldValue.all.each do |f|
puts "Processing field value [#{f.id}]"
if f.value.present?
f.value = f.value.gsub(/ã/, 'ã').gsub(/á/, 'á').gsub(/ê/, 'ê').gsub(/é/, 'é').gsub(/à /, 'í').gsub(/ó/, 'ó').gsub(/õ/, 'õ').gsub(/ú/, 'ú').gsub(/ç/, 'ç').gsub(/Ã/, 'à')
f.save
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment