mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 03:30:33 +02:00
Merge remote-tracking branch 'origin/108869472-objects_archive' into story/115762063--show-historical-nested
# Conflicts: # app/views/admin/domain_versions/_version.haml # app/views/admin/domain_versions/index.haml
This commit is contained in:
parent
5a582d872d
commit
ffe2ddd02c
3 changed files with 50 additions and 39 deletions
|
@ -3,6 +3,7 @@ module Versions
|
|||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
attr_accessor :version_loader
|
||||
has_paper_trail class_name: "#{model_name}Version"
|
||||
|
||||
# add creator and updator
|
||||
|
@ -65,6 +66,7 @@ module Versions
|
|||
select("distinct on (item_id) #{ver_klass.table_name}.*").
|
||||
map do |ver|
|
||||
o = new(ver.object)
|
||||
o.version_loader = ver
|
||||
ver.object_changes.to_h.each { |k, v| o[k]=v[-1] }
|
||||
o
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue