mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 17:01:44 +02:00
Address depricated, new contact requires, domain_contacts refactor
This commit is contained in:
parent
0e252b0b6b
commit
5fd73b037a
38 changed files with 402 additions and 501 deletions
17
db/migrate/20150318085110_update_domain_contact_data.rb
Normal file
17
db/migrate/20150318085110_update_domain_contact_data.rb
Normal file
|
@ -0,0 +1,17 @@
|
|||
class UpdateDomainContactData < ActiveRecord::Migration
|
||||
def change
|
||||
DomainContact.all.each do |dc|
|
||||
case dc.contact_type
|
||||
when 'admin'
|
||||
dc.type = 'AdminDomainContact'
|
||||
when 'tech'
|
||||
dc.type = 'TechDomainContact'
|
||||
end
|
||||
if dc.changes.present?
|
||||
puts "Changed: #{dc.id}: #{dc.changes.inspect} #{dc.save}"
|
||||
else
|
||||
puts "No changes: #{dc.id}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue