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: a439b37d64e8ecaeec57377d5db127935c4b64954f7b2471f935b6c80b8ef777
4
- data.tar.gz: 2c246306235393b7ff3dd2c98935535b943b1eba296cc03073d4c3187a19f763
3
+ metadata.gz: 610995c7d553d9d0297dd185308472f16747173affa787d2fc31bcac0fd08707
4
+ data.tar.gz: 2537b34e9d014b62071d700f8ff002970993ec2ca7adb69d60071faf21b3ca14
5
5
  SHA512:
6
- metadata.gz: 2f85826967ac33827d1ada925b772a12d5bb5cd7becb799bfc3d2f74fe97abf5c10d6ad45c3087d155d4021f58592649927f8a99eb3dbdb24c3800b87d1500f4
7
- data.tar.gz: b407e86259a9e18083f36f9759a34f7b2430c52c101fcf43f6c2dee713c6c47814bd2db7c6d8e9d7b96fbdac7ee244ae0e079c293dcf4e32bce6d8d55e943138
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
- <%= link_to "Restore",
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
- <%= link_to "Restore This Version",
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
- <%= link_to "Restore This Version",
71
+ <%= button_to "Restore This Version",
72
72
  restore_version_path(@version),
73
73
  method: :patch,
74
74
  data: {
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PaperTrailHistory
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.2'
5
5
  end
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.0
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-06 00:00:00.000000000 Z
10
+ date: 2025-08-07 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: paper_trail