diff --git a/app/models/contact.rb b/app/models/contact.rb index 1373ff97d..558292dbd 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -56,6 +56,8 @@ class Contact < ApplicationRecord after_save :update_related_whois_records + self.ignored_columns = %w[legacy_id legacy_history_id] + ORG = 'org' PRIV = 'priv' diff --git a/app/models/dnskey.rb b/app/models/dnskey.rb index 4772188a6..922844874 100644 --- a/app/models/dnskey.rb +++ b/app/models/dnskey.rb @@ -22,6 +22,8 @@ class Dnskey < ApplicationRecord FLAGS = %w(0 256 257) # 256 = ZSK, 257 = KSK DS_DIGEST_TYPE = [1,2] + self.ignored_columns = %w[legacy_domain_id] + def epp_code_map { '2005' => [ diff --git a/app/models/domain.rb b/app/models/domain.rb index bf8072cbf..96eb89616 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -169,6 +169,8 @@ class Domain < ApplicationRecord attr_accessor :registrant_typeahead, :update_me, :epp_pending_update, :epp_pending_delete, :reserved_pw + self.ignored_columns = %w[legacy_id legacy_registrar_id legacy_registrant_id] + def subordinate_nameservers nameservers.select { |x| x.hostname.end_with?(name) } end diff --git a/app/models/domain_contact.rb b/app/models/domain_contact.rb index 26d23dd56..910f4e445 100644 --- a/app/models/domain_contact.rb +++ b/app/models/domain_contact.rb @@ -8,6 +8,8 @@ class DomainContact < ApplicationRecord attr_accessor :value_typeahead + self.ignored_columns = %w[legacy_domain_id legacy_contact_id] + def epp_code_map { '2302' => [ diff --git a/app/models/nameserver.rb b/app/models/nameserver.rb index 77c7417de..bf76868dc 100644 --- a/app/models/nameserver.rb +++ b/app/models/nameserver.rb @@ -34,6 +34,8 @@ class Nameserver < ApplicationRecord delegate :name, to: :domain, prefix: true + self.ignored_columns = %w[legacy_domain_id] + def epp_code_map { '2302' => [ diff --git a/app/models/registrar.rb b/app/models/registrar.rb index 69a8a1dee..8f41d62ca 100644 --- a/app/models/registrar.rb +++ b/app/models/registrar.rb @@ -46,6 +46,8 @@ class Registrar < ApplicationRecord RegenerateRegistrarWhoisesJob.enqueue id end + self.ignored_columns = %w[legacy_id] + class << self def ordered order(name: :asc) @@ -194,4 +196,4 @@ class Registrar < ApplicationRecord def vat_liable_in_foreign_country? !vat_liable_locally? end -end \ No newline at end of file +end diff --git a/app/models/reserved_domain.rb b/app/models/reserved_domain.rb index 871c1991a..11c9bb2f5 100644 --- a/app/models/reserved_domain.rb +++ b/app/models/reserved_domain.rb @@ -8,6 +8,8 @@ class ReservedDomain < ApplicationRecord alias_attribute :registration_code, :password + self.ignored_columns = %w[legacy_id] + class << self def pw_for(domain_name) name_in_ascii = SimpleIDN.to_ascii(domain_name) diff --git a/app/models/user.rb b/app/models/user.rb index cc299640c..6b16bd508 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -5,6 +5,8 @@ class User < ApplicationRecord attr_accessor :phone + self.ignored_columns = %w[legacy_id] + def id_role_username "#{self.id}-#{self.class}: #{self.username}" end diff --git a/doc/registrant-api/v1/domain.md b/doc/registrant-api/v1/domain.md index 5a5a61366..ffea81826 100644 --- a/doc/registrant-api/v1/domain.md +++ b/doc/registrant-api/v1/domain.md @@ -60,9 +60,6 @@ Content-Type: application/json "period_unit":"y", "creator_str":null, "updator_str":null, - "legacy_id":null, - "legacy_registrar_id":null, - "legacy_registrant_id":null, "outzone_at":"2016-09-24T09:11:14.861Z", "delete_date":"2016-10-24", "registrant_verification_asked_at":null, @@ -175,9 +172,6 @@ Content-Type: application/json "period_unit":"y", "creator_str":null, "updator_str":null, - "legacy_id":null, - "legacy_registrar_id":null, - "legacy_registrant_id":null, "outzone_at":"2016-09-24T09:11:14.861Z", "delete_date":"2016-10-24", "registrant_verification_asked_at":null, @@ -282,9 +276,6 @@ Content-Type: application/json "period_unit":"y", "creator_str":null, "updator_str":null, - "legacy_id":null, - "legacy_registrar_id":null, - "legacy_registrant_id":null, "outzone_at":"2016-09-24T09:11:14.861Z", "delete_date":"2016-10-24", "registrant_verification_asked_at":null, diff --git a/doc/registrant-api/v1/registry_lock.md b/doc/registrant-api/v1/registry_lock.md index 61a2c0839..17f4c6f6e 100644 --- a/doc/registrant-api/v1/registry_lock.md +++ b/doc/registrant-api/v1/registry_lock.md @@ -60,9 +60,6 @@ Content-Type: application/json "period_unit":"y", "creator_str":null, "updator_str":null, - "legacy_id":null, - "legacy_registrar_id":null, - "legacy_registrant_id":null, "outzone_at":"2016-09-24T09:11:14.861Z", "delete_date":"2016-10-24", "registrant_verification_asked_at":null, @@ -204,9 +201,6 @@ Content-Type: application/json "period_unit":"y", "creator_str":null, "updator_str":null, - "legacy_id":null, - "legacy_registrar_id":null, - "legacy_registrant_id":null, "outzone_at":"2016-09-24T09:11:14.861Z", "delete_date":"2016-10-24", "registrant_verification_asked_at":null, diff --git a/doc/repp/v1/contact.md b/doc/repp/v1/contact.md index 71bf6276d..41f45551f 100644 --- a/doc/repp/v1/contact.md +++ b/doc/repp/v1/contact.md @@ -50,7 +50,6 @@ Content-Type: application/json "zip": "11111", "country_code": "EE", "state": null, - "legacy_id": null, "statuses": [ "ok" ], diff --git a/doc/repp/v1/domain.md b/doc/repp/v1/domain.md index 035bb1e9a..c6734cbe2 100644 --- a/doc/repp/v1/domain.md +++ b/doc/repp/v1/domain.md @@ -48,9 +48,6 @@ Content-Type: application/json "period_unit": "y", "creator_str": null, "updator_str": null, - "legacy_id": null, - "legacy_registrar_id": null, - "legacy_registrant_id": null, "outzone_at": "2016-09-24T09:11:14.861Z", "delete_date": "2016-10-24", "registrant_verification_asked_at": null, diff --git a/lib/serializers/registrant_api/domain.rb b/lib/serializers/registrant_api/domain.rb index 500d6c08c..19594fe20 100644 --- a/lib/serializers/registrant_api/domain.rb +++ b/lib/serializers/registrant_api/domain.rb @@ -32,9 +32,6 @@ module Serializers period_unit: domain.period_unit, creator_str: domain.creator_str, updator_str: domain.updator_str, - legacy_id: domain.legacy_id, - legacy_registrar_id: domain.legacy_registrar_id, - legacy_registrant_id: domain.legacy_registrant_id, outzone_at: domain.outzone_at, delete_date: domain.delete_date, registrant_verification_asked_at: domain.registrant_verification_asked_at, diff --git a/test/lib/serializers/registrant_api/domain_test.rb b/test/lib/serializers/registrant_api/domain_test.rb index 08648b29c..9bd70f626 100644 --- a/test/lib/serializers/registrant_api/domain_test.rb +++ b/test/lib/serializers/registrant_api/domain_test.rb @@ -70,7 +70,7 @@ class SerializersRegistrantApiDomainTest < ActiveSupport::TestCase def test_other_fields_are_also_present keys = %i[id name registrar registered_at valid_to created_at updated_at registrant tech_contacts admin_contacts transfer_code name_dirty name_puny period - period_unit creator_str updator_str legacy_id legacy_registrar_id legacy_registrant_id + period_unit creator_str updator_str outzone_at delete_date registrant_verification_asked_at registrant_verification_token pending_json force_delete_date statuses locked_by_registrant_at status_notes nameservers]