6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/active_admin/views/latest_versions.rb', line 6
def build(resource, _attributes = {})
panel 'Latest versions' do
table_for resource.latest_versions do
column :id
column :event
column :who
column :object_changes do |version|
version_attributes_diff(version.object_changes)
end
column :additional_objects_changes do |version|
version_attributes_diff(version.additional_objects_changes)
end
column :created_at
column :actions do |version|
link_to 'View', admin_content_version_path(version)
end
end
div do
link_to 'View all versions', admin_content_versions_path({
'q[item_type_eq]' => resource.class.name,
'q[item_id_eq]' => resource.id,
})
end
end
end
|