mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 07:04:47 +02:00
History: Show last state of contact on contact destroy event
This commit is contained in:
parent
a41abf8176
commit
e40737408f
1 changed files with 2 additions and 1 deletions
|
@ -3,7 +3,8 @@ module ObjectVersionsHelper
|
|||
version.object_changes.to_h.each do |key, value|
|
||||
method_name = "#{key}=".to_sym
|
||||
if new_object.respond_to?(method_name)
|
||||
new_object.public_send(method_name, value.last)
|
||||
delete_action = version.event == 'destroy'
|
||||
new_object.public_send(method_name, delete_action ? value.first : value.last)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue