From 8926c70bc384f58f47ee05224520a5eae053dcf4 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Fri, 28 May 2021 16:06:12 +0500 Subject: [PATCH] Fix contact version generation --- app/views/admin/domain_versions/archive.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/domain_versions/archive.haml b/app/views/admin/domain_versions/archive.haml index 03e556c9c..c0ed6fff0 100644 --- a/app/views/admin/domain_versions/archive.haml +++ b/app/views/admin/domain_versions/archive.haml @@ -67,7 +67,7 @@ - else - contact = Contact.all_versions_for([domain.registrant_id], version.created_at).first - if contact.nil? && ver = Version::ContactVersion.where(item_id: domain.registrant_id).last - - contact = Contact.new(ver.object.to_h.merge(ver.object_changes.to_h&.slice(*Domain&.column_names))) + - contact = Contact.new(ver.object.to_h.merge(ver.object_changes.to_h.each_with_object({}) {|(k,v), o| o[k] = v.last })&.slice(*Contact&.column_names)) = contact.try(:name) = " ".html_safe = "(#{t(:deleted)})"