Skip to content

Commit 432af25

Browse files
committed
Drop rails 6.1/7.0 and ruby 3.0/3.1 support
1 parent 2b4ebbb commit 432af25

File tree

16 files changed

+76
-110
lines changed

16 files changed

+76
-110
lines changed

.github/CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ For most development, testing with sqlite only is easiest and sufficient. CI
5454
will run the rest.
5555

5656
```
57-
DB=sqlite bundle exec appraisal rails-6.1 rake
58-
DB=sqlite bundle exec appraisal rails-7.0 rake
59-
DB=mysql bundle exec appraisal rails-7.0 rake
57+
DB=sqlite bundle exec appraisal rails-7.1 rake
58+
DB=sqlite bundle exec appraisal rails-8.0 rake
59+
DB=mysql bundle exec appraisal rails-7.1 rake
6060
createuser --superuser postgres
61-
DB=postgres bundle exec appraisal rails-7.0 rake
61+
DB=postgres bundle exec appraisal rails-7.1 rake
6262
```
6363

6464
## The dummy_app

.github/workflows/test.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
uses: ruby/setup-ruby@v1
1818
with:
1919
# See "Lowest supported ruby version" in CONTRIBUTING.md
20-
ruby-version: '3.0'
20+
ruby-version: '3.2'
2121
- name: Bundle
2222
run: |
2323
gem install bundler
@@ -59,18 +59,11 @@ jobs:
5959
# have set this up with each database as a separate job, but then we'd be
6060
# duplicating the matrix configuration three times.
6161
matrix:
62-
gemfile: [ 'rails_6.1', 'rails_7.0', 'rails_7.1', 'rails_7.2', 'rails_8.0' ]
62+
gemfile: [ 'rails_7.1', 'rails_7.2', 'rails_8.0' ]
6363

6464
# To keep matrix size down, only test highest and lowest rubies.
6565
# See "Lowest supported ruby version" in CONTRIBUTING.md
66-
ruby: [ '3.0', '3.3' ]
67-
exclude:
68-
# Rails 8 requires ruby 3.2+.
69-
- gemfile: 'rails_8.0'
70-
ruby: '3.0'
71-
# Rails 7.2 requires ruby 3.1+.
72-
- gemfile: 'rails_7.2'
73-
ruby: '3.0'
66+
ruby: [ '3.2', '3.4' ]
7467
steps:
7568
- name: Checkout source
7669
uses: actions/checkout@v4

.rubocop.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ AllCops:
2525
NewCops: enable
2626

2727
# See "Lowest supported ruby version" in CONTRIBUTING.md
28-
TargetRubyVersion: 3.0
28+
TargetRubyVersion: 3.2
2929

3030
Layout/ArgumentAlignment:
3131
EnforcedStyle: with_fixed_indentation
@@ -67,7 +67,7 @@ Layout/SpaceAroundOperators:
6767
# from these is of questionable value.
6868
Metrics/AbcSize:
6969
Exclude:
70-
- 'spec/dummy_app/db/migrate/*'
70+
- "spec/dummy_app/db/migrate/*"
7171

7272
# Not a useful metric compared to, e.g. `AbcSize`.
7373
Metrics/BlockLength:
@@ -184,8 +184,8 @@ Style/IfUnlessModifier:
184184
# - https://github.com/bbatsov/ruby-style-guide/issues/556
185185
Style/ModuleFunction:
186186
Exclude:
187-
- 'lib/paper_trail/serializers/json.rb'
188-
- 'lib/paper_trail/serializers/yaml.rb'
187+
- "lib/paper_trail/serializers/json.rb"
188+
- "lib/paper_trail/serializers/yaml.rb"
189189

190190
# Too subtle to lint. Use `format` for multiple variables. For single variables,
191191
# use either interpolation or concatenation, whichever is easier to read.

.rubocop_todo.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2025-03-31 17:33:57 UTC using RuboCop version 1.75.1.
3+
# on 2025-03-31 20:24:49 UTC using RuboCop version 1.75.1.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
@@ -108,18 +108,11 @@ Rails/RedundantActiveRecordAllMethod:
108108
Exclude:
109109
- 'spec/paper_trail/cleaner_spec.rb'
110110

111-
# Offense count: 13
111+
# Offense count: 1
112112
# This cop supports unsafe autocorrection (--autocorrect-all).
113-
Security/YAMLLoad:
113+
Style/ArrayIntersect:
114114
Exclude:
115-
- 'lib/paper_trail/serializers/yaml.rb'
116-
- 'spec/models/book_spec.rb'
117-
- 'spec/models/gadget_spec.rb'
118-
- 'spec/models/no_object_spec.rb'
119-
- 'spec/models/person_spec.rb'
120-
- 'spec/models/version_spec.rb'
121-
- 'spec/paper_trail/events/destroy_spec.rb'
122-
- 'spec/paper_trail/serializer_spec.rb'
115+
- 'lib/paper_trail/events/base.rb'
123116

124117
# Offense count: 4
125118
# This cop supports unsafe autocorrection (--autocorrect-all).

Appraisals

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,6 @@
99
# > the version from the appraisal takes precedence.
1010
# > https://github.com/thoughtbot/appraisal
1111

12-
appraise "rails-6.1" do
13-
gem "rails", "~> 6.1.0"
14-
gem "rails-controller-testing", "~> 1.0.5"
15-
end
16-
17-
appraise "rails-7.0" do
18-
gem "rails", "~> 7.0.3.1"
19-
gem "rails-controller-testing", "~> 1.0.5"
20-
end
21-
2212
appraise "rails-7.1" do
2313
gem "rails", "~> 7.1.0"
2414
gem "rails-controller-testing", "~> 1.0.5"

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ recommendations of [keepachangelog.com](http://keepachangelog.com/).
1717

1818
- None
1919

20+
### Dependencies
21+
- Drop support for Rails 6.1, which [reached EoL on 2024-10-01][2]
22+
- Drop support for Rails 7.0, which [reached EoL on 2025-04-01][2]
23+
- Drop support for Ruby 3.0, which [reached EoL on 2024-04-23][3]
24+
- Drop support for Ruby 3.1, which [reached EoL on 2024-03-31][3]
25+
2026
## 16.0.0 (2024-11-08)
2127

2228
### Breaking Changes

lib/paper_trail.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,6 @@ def version
115115
VERSION::STRING
116116
end
117117

118-
def active_record_gte_7_0?
119-
@active_record_gte_7_0 ||= ::ActiveRecord.gem_version >= ::Gem::Version.new("7.0.0")
120-
end
121-
122118
def deprecator
123119
@deprecator ||= ActiveSupport::Deprecation.new("16.0", "PaperTrail")
124120
end

lib/paper_trail/attribute_serializers/cast_attribute_serializer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def deserialize(attr, val)
3232
if defined_enums[attr] && val.is_a?(::String)
3333
# Because PT 4 used to save the string version of enums to `object_changes`
3434
val
35-
elsif PaperTrail.active_record_gte_7_0? && val.is_a?(ActiveRecord::Type::Time::Value)
35+
elsif val.is_a?(ActiveRecord::Type::Time::Value)
3636
# Because Rails 7 time attribute throws a delegation error when you deserialize
3737
# it with the factory.
3838
# See ActiveRecord::Type::Time::Value crashes when loaded from YAML on rails 7.0

lib/paper_trail/attribute_serializers/object_attribute.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ def initialize(model_class)
1010
@model_class = model_class
1111

1212
# ActiveRecord since 7.0 has a built-in encryption mechanism
13-
@encrypted_attributes =
14-
if PaperTrail.active_record_gte_7_0?
15-
@model_class.encrypted_attributes&.map(&:to_s)
16-
end
13+
@encrypted_attributes = @model_class.encrypted_attributes&.map(&:to_s)
1714
end
1815

1916
def serialize(attributes)

lib/paper_trail/attribute_serializers/object_changes_attribute.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ def initialize(item_class)
1010
@item_class = item_class
1111

1212
# ActiveRecord since 7.0 has a built-in encryption mechanism
13-
@encrypted_attributes =
14-
if PaperTrail.active_record_gte_7_0?
15-
@item_class.encrypted_attributes&.map(&:to_s)
16-
end
13+
@encrypted_attributes = @item_class.encrypted_attributes&.map(&:to_s)
1714
end
1815

1916
def serialize(changes)

0 commit comments

Comments
 (0)