mirror of
https://github.com/internetee/registry.git
synced 2025-05-28 16:39:55 +02:00
109259406-punycode
This commit is contained in:
parent
4470c679f7
commit
e9895df211
1 changed files with 15 additions and 0 deletions
15
lib/tasks/convert.rake
Normal file
15
lib/tasks/convert.rake
Normal file
|
@ -0,0 +1,15 @@
|
|||
namespace :convert do
|
||||
desc 'Convert punycodes to unicode'
|
||||
task punycode: :environment do
|
||||
start = Time.zone.now.to_f
|
||||
|
||||
puts "-----> Convert domain punycodes to unicode..."
|
||||
|
||||
count = 0
|
||||
Domain.find_each(:batch_size => 1000) do |x|
|
||||
count += 1
|
||||
x.update_column(:name_puny, (SimpleIDN.to_unicode(x.name)))
|
||||
end
|
||||
puts "-----> all done in #{(Time.zone.now.to_f - start).round(2)} seconds"
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue