mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 09:27:19 +02:00
parent
762f891b84
commit
cefa37d081
5 changed files with 6 additions and 6 deletions
|
@ -67,7 +67,7 @@ module Versions
|
||||||
map do |ver|
|
map do |ver|
|
||||||
o = new(ver.object)
|
o = new(ver.object)
|
||||||
o.version_loader = ver
|
o.version_loader = ver
|
||||||
ver.object_changes.to_h.each { |k, v| o[k]=v[-1] }
|
ver.object_changes.to_h.each { |k, v| o.public_send("#{k}=", v[-1]) }
|
||||||
o
|
o
|
||||||
end
|
end
|
||||||
not_in_history = where(id: (ids.to_a - from_history.map(&:id)))
|
not_in_history = where(id: (ids.to_a - from_history.map(&:id)))
|
||||||
|
|
|
@ -58,7 +58,7 @@
|
||||||
- @versions.each do |version|
|
- @versions.each do |version|
|
||||||
- if version
|
- if version
|
||||||
- contact = Contact.new(version.object.to_h)
|
- contact = Contact.new(version.object.to_h)
|
||||||
- version.object_changes.to_h.each{|k,v| contact[k]=v.last}
|
- version.object_changes.to_h.each { |k,v| contact.public_send("#{k}=", v.last) }
|
||||||
|
|
||||||
%tr
|
%tr
|
||||||
%td= link_to(contact.name, admin_contact_version_path(version.id))
|
%td= link_to(contact.name, admin_contact_version_path(version.id))
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
- contact = Contact.new(@version.object.to_h)
|
- contact = Contact.new(@version.object.to_h)
|
||||||
- @version.object_changes.to_h.each{|k,v| contact[k]=v.last}
|
- @version.object_changes.to_h.each { |k,v| contact.public_send("#{k}=", v.last ) }
|
||||||
= render 'shared/title', name: contact.name
|
= render 'shared/title', name: contact.name
|
||||||
|
|
||||||
.row
|
.row
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
- @versions.each do |version|
|
- @versions.each do |version|
|
||||||
- if version
|
- if version
|
||||||
- domain = Domain.new(version.object.to_h)
|
- domain = Domain.new(version.object.to_h)
|
||||||
- version.object_changes.to_h.each{|k,v| domain[k]=v.last}
|
- version.object_changes.to_h.each{|k,v| domain.public_send("#{k}=", v.last) }
|
||||||
|
|
||||||
%tr
|
%tr
|
||||||
%td= link_to(domain.name, admin_domain_version_path(version.id))
|
%td= link_to(domain.name, admin_domain_version_path(version.id))
|
||||||
|
@ -66,7 +66,7 @@
|
||||||
- else
|
- else
|
||||||
- contact = Contact.all_versions_for([domain.registrant_id], version.created_at).first
|
- contact = Contact.all_versions_for([domain.registrant_id], version.created_at).first
|
||||||
- if contact.nil? && ver = ContactVersion.where(item_id: domain.registrant_id).last
|
- 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[k]=v.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.try(:name)
|
= contact.try(:name)
|
||||||
= " ".html_safe
|
= " ".html_safe
|
||||||
= "(#{t(:deleted)})"
|
= "(#{t(:deleted)})"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
- domain = Domain.new(@version.object.to_h)
|
- domain = Domain.new(@version.object.to_h)
|
||||||
- @version.object_changes.to_h.each{|k,v| domain[k]=v.last}
|
- @version.object_changes.to_h.each{|k,v| domain.public_send("#{k}=", v.last) }
|
||||||
|
|
||||||
- if @version
|
- if @version
|
||||||
- children = HashWithIndifferentAccess.new(@version.children)
|
- children = HashWithIndifferentAccess.new(@version.children)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue