Import tech contacts too

This commit is contained in:
Martin Lensment 2015-03-17 11:50:45 +02:00 committed by Priit Tark
parent d5a7704b87
commit 968e383f9e
6 changed files with 25 additions and 6 deletions

View file

@ -84,7 +84,7 @@ class Contact < ActiveRecord::Base
end
def to_s
name
name || '[no name]'
end
def ident_valid_format?

View file

@ -73,9 +73,9 @@ class Dnskey < ActiveRecord::Base
hex = [domain.name_in_wire_format, flags_hex, protocol_hex, alg_hex, public_key_hex].join
bin = self.class.hex_to_bin(hex)
if Setting.ds_algorithm == 1
if ds_digest_type == 1
self.ds_digest = Digest::SHA1.hexdigest(bin).upcase
elsif Setting.ds_algorithm == 2
elsif ds_digest_type == 2
self.ds_digest = Digest::SHA256.hexdigest(bin).upcase
end
end

View file

@ -10,5 +10,6 @@ module Legacy
has_many :object_states, -> { where('valid_to IS NULL') }, foreign_key: :object_id
has_many :dnskeys, foreign_key: :keysetid, primary_key: :keyset
has_many :domain_contact_maps, foreign_key: :domainid
has_many :nsset_contact_maps, foreign_key: :nssetid, primary_key: :nsset
end
end

View file

@ -2,6 +2,6 @@ module Legacy
class DomainContactMap < Db
self.table_name = :domain_contact_map
belongs_to :contact, foreign_key: :contactid, primary_key: :legacy_id, class_name: '::Contact'
# belongs_to :contact, foreign_key: :contactid, primary_key: :legacy_id, class_name: '::Contact'
end
end

View file

@ -0,0 +1,5 @@
module Legacy
class NssetContactMap < Db
self.table_name = :nsset_contact_map
end
end