paper_trail_history 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 610995c7d553d9d0297dd185308472f16747173affa787d2fc31bcac0fd08707
|
4
|
+
data.tar.gz: 2537b34e9d014b62071d700f8ff002970993ec2ca7adb69d60071faf21b3ca14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d21d583f1bd7d035c751c8362de1d77e49df19d1a01970e8fd49c973f9c98f84451c7fcbca8a19ec2d712b37c4a4a85600cb5776814813f8b891e7bceef2e010
|
7
|
+
data.tar.gz: cf3bf56a5e65c21281bef09e298ea1038af99c39cf5899675adcf9dbe910a23591229f5b92e7e357461f2dc37155071454ba9bf7cb2b86c5b7b4a94e3e76391a
|
@@ -57,9 +57,10 @@ module PaperTrailHistory
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def self.find_version_across_tables(version_id)
|
60
|
-
# Try to find the version in all possible version classes
|
60
|
+
# Try to find the version in all possible version classes, using unscoped to bypass any default scope
|
61
|
+
# and/or soft delete mechanism like acts_as_paranoid
|
61
62
|
all_version_classes.each do |version_class|
|
62
|
-
version = version_class.find_by(id: version_id)
|
63
|
+
version = version_class.unscoped.find_by(id: version_id)
|
63
64
|
return version if version
|
64
65
|
end
|
65
66
|
nil
|
@@ -43,7 +43,7 @@
|
|
43
43
|
<div class="btn-group btn-group-sm">
|
44
44
|
<%= link_to "View", version_path(decorated_version.version.id), class: "btn btn-outline-primary btn-sm" %>
|
45
45
|
<% if decorated_version.can_restore? %>
|
46
|
-
<%=
|
46
|
+
<%= button_to "Restore",
|
47
47
|
restore_version_path(decorated_version.version.id),
|
48
48
|
method: :patch,
|
49
49
|
data: {
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<h1>Version Details</h1>
|
11
11
|
<div>
|
12
12
|
<% if @decorated_version.can_restore? %>
|
13
|
-
<%=
|
13
|
+
<%= button_to "Restore This Version",
|
14
14
|
restore_version_path(@version),
|
15
15
|
method: :patch,
|
16
16
|
data: {
|
@@ -68,7 +68,7 @@
|
|
68
68
|
This will restore the record to the state it was in at this version.
|
69
69
|
<strong>This action cannot be undone</strong>, but will create a new version entry.
|
70
70
|
</p>
|
71
|
-
<%=
|
71
|
+
<%= button_to "Restore This Version",
|
72
72
|
restore_version_path(@version),
|
73
73
|
method: :patch,
|
74
74
|
data: {
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paper_trail_history
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Deutscher
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-08-
|
10
|
+
date: 2025-08-07 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: paper_trail
|