-
Notifications
You must be signed in to change notification settings - Fork 901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hotfix for support of Rails 7.2.0 #1485
Changes from 2 commits
bb656a4
5343ce6
50b53b3
ada7f38
c1b17d5
238c87c
face459
32221c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,7 +92,7 @@ Choose version: | |
|
||
| paper_trail | ruby | activerecord | | ||
|-------------|----------|---------------| | ||
| unreleased | >= 3.0.0 | >= 6.1, < 7.2 | | ||
| unreleased | >= 3.0.0 | >= 6.1, <= 7.2 | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kalashnikovisme and There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it 🙂 Thanks! |
||
| 15 | >= 3.0.0 | >= 6.1, < 7.2 | | ||
| 14 | >= 2.7.0 | >= 6.0, < 7.1 | | ||
| 13 | >= 2.6.0 | >= 5.2, < 7.1 | | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# This file was generated by Appraisal | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "rails", "~> 7.2.0" | ||
gem "rails-controller-testing", "~> 1.0.5" | ||
|
||
gemspec path: "../" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
# Is used to handle the deprecation warning in the different versions of ActiveRecord. | ||
module ActiveRecordVersionConcern | ||
module_function | ||
|
||
def deprecation | ||
if Gem::Version.new(ActiveRecord::VERSION::STRING) < Gem::Version.new("7.2") | ||
::ActiveSupport::Deprecation | ||
else | ||
::ActiveSupport::Deprecation._instance | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ module PaperTrail | |
# versions. | ||
module Compatibility | ||
ACTIVERECORD_GTE = ">= 6.1" # enforced in gemspec | ||
ACTIVERECORD_LT = "< 7.2" # not enforced in gemspec | ||
ACTIVERECORD_LT = "< 7.3" # not enforced in gemspec | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was set to |
||
|
||
E_INCOMPATIBLE_AR = <<-EOS | ||
PaperTrail %s is not compatible with ActiveRecord %s. We allow PT | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -14,7 +14,7 @@ module PaperTrail | |||||
|
||||||
context "when incompatible" do | ||||||
it "writes a warning to stderr" do | ||||||
ar_version = ::Gem::Version.new("7.2.0") | ||||||
ar_version = ::Gem::Version.new("8.0.0") | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be 7.3 in line with the other changes?
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a pretty interesting question. I think no because there is At the first version of this pull request, I used So, I think that we should use 7.3 in cases with |
||||||
expect { | ||||||
described_class.check_activerecord(ar_version) | ||||||
}.to output(/not compatible/).to_stderr | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be updated?
see https://endoflife.date/ruby
per https://github.com/paper-trail-gem/paper_trail/blob/master/.github/CONTRIBUTING.md#lowest-supported-ruby-version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch! Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kalashnikovisme looks like the following need updating as well according to CONTRIBUTING:
paper_trail/paper_trail.gemspec
Line 50 in be31c66
paper_trail/.rubocop.yml
Line 26 in be31c66
paper_trail/.github/workflows/test.yml
Line 20 in be31c66
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joshRpowell is right. This 3 files should be updated, @kalashnikovisme . And why have you removed 3.2?