Use Hash methods instead of public_send to compose hash

This commit is contained in:
Karl Erik Õunapuu 2020-09-30 15:19:44 +03:00
parent 7b6060b4fb
commit 45f4e5cbbc
No known key found for this signature in database
GPG key ID: C9DD647298A34764

View file

@ -67,7 +67,7 @@
- else
- contact = Contact.all_versions_for([domain.registrant_id], version.created_at).first
- if contact.nil? && ver = ContactVersion.where(item_id: domain.registrant_id).last
- contact = Contact.new(ver.object.to_h.merge(ver.object_changes.to_h.each_with_object({}){|(k,v), o| o.public_send("#{k}=", v.last) } ))
- contact = Contact.new(ver.object.to_h.merge(ver.object_changes.to_h.each_with_object({}) {|(k,v), o| o[k] = v.last }))
= contact.try(:name)
= " ".html_safe
= "(#{t(:deleted)})"