mirror of
https://github.com/internetee/registry.git
synced 2025-05-21 19:59:38 +02:00
109259406-name_convert
This commit is contained in:
parent
e9895df211
commit
8bb49cdd42
1 changed files with 5 additions and 2 deletions
|
@ -4,12 +4,15 @@ namespace :convert 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)))
|
||||
old_name = x.name.strip.downcase
|
||||
x.name = SimpleIDN.to_unicode(old_name)
|
||||
x.name_puny = SimpleIDN.to_ascii(old_name)
|
||||
x.save(validate: false)
|
||||
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