Skip to content

Commit 729d6ea

Browse files
committed
Resolve loading issues with PT v12+ and ensure legacy PT compatibility
1 parent 9ffbd10 commit 729d6ea

File tree

58 files changed

+515
-45
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+515
-45
lines changed

.github/workflows/test.yml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,20 @@ jobs:
1313
matrix:
1414
include:
1515
### TEST ALL RUBY VERSIONS, USE DEFAULT GEMFILE
16-
- ruby: 2.5
1716
- ruby: 2.6
1817
- ruby: 2.7
1918
- ruby: 3.0
2019
- ruby: 3.1
2120

2221
### RAILS VERSION TESTING
2322
- ruby: 2.6
24-
gemfile: gemfiles/ar_5.2_pt_12.0.gemfile
23+
gemfile: gemfiles/sqlite3_ar_5.2_pt_12.0.gemfile
2524
- ruby: 2.6
26-
gemfile: gemfiles/ar_6.0_pt_12.0.gemfile
25+
gemfile: gemfiles/sqlite3_ar_6.0_pt_12.0.gemfile
2726
- ruby: 2.6
28-
gemfile: gemfiles/ar_6.1_pt_12.0.gemfile
27+
gemfile: gemfiles/sqlite3_ar_6.1_pt_12.0.gemfile
2928
- ruby: 3.1
30-
gemfile: gemfiles/ar_7.0_pt_12.0.gemfile
29+
gemfile: gemfiles/sqlite3_ar_7.0_pt_12.0.gemfile
3130

3231
env:
3332
BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
@@ -70,13 +69,13 @@ jobs:
7069
### RAILS VERSION TESTING
7170
### DONT WORRY ABOUT TESTING ALL RUBY VERSIONS. THIS IS COVERED IN THE SQLITE3 TESTS
7271
- ruby: 2.6
73-
gemfile: gemfiles/ar_5.2_pt_12.0.gemfile
72+
gemfile: gemfiles/mysql2_ar_5.2_pt_12.0.gemfile
7473
- ruby: 2.6
75-
gemfile: gemfiles/ar_6.0_pt_12.0.gemfile
74+
gemfile: gemfiles/mysql2_ar_6.0_pt_12.0.gemfile
7675
- ruby: 2.6
77-
gemfile: gemfiles/ar_6.1_pt_12.0.gemfile
76+
gemfile: gemfiles/mysql2_ar_6.1_pt_12.0.gemfile
7877
- ruby: 3.1
79-
gemfile: gemfiles/ar_7.0_pt_12.0.gemfile
78+
gemfile: gemfiles/mysql2_ar_7.0_pt_12.0.gemfile
8079

8180
env:
8281
BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
@@ -122,13 +121,13 @@ jobs:
122121
### RAILS VERSION TESTING
123122
### DONT WORRY ABOUT TESTING ALL RUBY VERSIONS. THIS IS COVERED IN THE SQLITE3 TESTS
124123
- ruby: 2.6
125-
gemfile: gemfiles/ar_5.2_pt_12.0.gemfile
124+
gemfile: gemfiles/pg_ar_5.2_pt_12.0.gemfile
126125
- ruby: 2.6
127-
gemfile: gemfiles/ar_6.0_pt_12.0.gemfile
126+
gemfile: gemfiles/pg_ar_6.0_pt_12.0.gemfile
128127
- ruby: 2.6
129-
gemfile: gemfiles/ar_6.1_pt_12.0.gemfile
128+
gemfile: gemfiles/pg_ar_6.1_pt_12.0.gemfile
130129
- ruby: 3.1
131-
gemfile: gemfiles/ar_7.0_pt_12.0.gemfile
130+
gemfile: gemfiles/pg_ar_7.0_pt_12.0.gemfile
132131

133132
env:
134133
BUNDLE_GEMFILE: "${{ matrix.gemfile }}"

Appraisals

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
### WHEN UPDATING THESE VERSIONS DONT FORGOT TO UPDATE .github/workflows/test.yml
1010
pt_versions = [
11-
#'~>9.2', ### Likely not compatible with the new PT 12 loading mechanism
12-
#'~>10.0', ### Likely not compatible with the new PT 12 loading mechanism
13-
#'~>11.0', ### Likely not compatible with the new PT 12 loading mechanism
11+
'~>9.2', ### Likely not compatible with the new PT 12 loading mechanism
12+
'~>10.0', ### Likely not compatible with the new PT 12 loading mechanism
13+
'~>11.0', ### Likely not compatible with the new PT 12 loading mechanism
1414
'~>12.0',
1515
]
1616

@@ -33,19 +33,24 @@ ar_versions = [
3333
],
3434
]
3535

36+
db_gems = ['sqlite3', 'mysql2', 'pg']
37+
3638
ar_versions.each do |ar_ver, compatible_pt_versions|
3739
compatible_pt_versions.each do |pt_ver|
38-
appraise "ar_#{ar_ver.sub('~>','')} pt_#{pt_ver.sub('~>','')}" do
39-
gem "activerecord", ar_ver
40+
db_gems.each do |db_gem|
41+
appraise "#{db_gem}_ar_#{ar_ver.sub('~>','')} pt_#{pt_ver.sub('~>','')}" do
42+
gem "activerecord", ar_ver
4043

41-
if pt_ver == 'master'
42-
gem "paper_trail", git: 'https://github.com/paper-trail-gem/paper_trail.git'
43-
else
44-
gem "paper_trail", pt_ver
45-
end
44+
if pt_ver == 'master'
45+
gem "paper_trail", git: 'https://github.com/paper-trail-gem/paper_trail.git'
46+
else
47+
gem "paper_trail", pt_ver
48+
end
4649

47-
gem "rails-controller-testing"
48-
end
50+
gem "rails-controller-testing"
4951

52+
gem db_gem
53+
end
54+
end
5055
end
5156
end

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
### 2.1.3 - [View Diff](https://github.com/westonganger/paper_trail-association_tracking/compare/v2.1.1...v2.1.3)
99

1010
- [PR #24](https://github.com/westonganger/paper_trail-association_tracking/pull/24) - Fix reification on STI models that have parent child relationships
11-
- Last version that is compatible with PT-v11 and below, due to the recent change in the PT loading mechanism
1211

1312
### 2.1.2
1413

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "rails-controller-testing"
6+
gem "paper_trail", "~>10.0"
7+
gem "activerecord", "~>5.2"
8+
gem "mysql2"
9+
10+
gemspec path: "../"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "rails-controller-testing"
6+
gem "paper_trail", "~>11.0"
7+
gem "activerecord", "~>5.2"
8+
gem "mysql2"
9+
10+
gemspec path: "../"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "rails-controller-testing"
6+
gem "paper_trail", "~>12.0"
7+
gem "activerecord", "~>5.2"
8+
gem "mysql2"
9+
10+
gemspec path: "../"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "rails-controller-testing"
6+
gem "paper_trail", "~>9.2"
7+
gem "activerecord", "~>5.2"
8+
gem "mysql2"
9+
10+
gemspec path: "../"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "rails-controller-testing"
6+
gem "paper_trail", "~>10.0"
7+
gem "activerecord", "~>6.0"
8+
gem "mysql2"
9+
10+
gemspec path: "../"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "rails-controller-testing"
6+
gem "paper_trail", "~>11.0"
7+
gem "activerecord", "~>6.0"
8+
gem "mysql2"
9+
10+
gemspec path: "../"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "rails-controller-testing"
6+
gem "paper_trail", "~>12.0"
7+
gem "activerecord", "~>6.0"
8+
gem "mysql2"
9+
10+
gemspec path: "../"

0 commit comments

Comments
 (0)