Skip to content

Commit 34d7bd4

Browse files
committed
Add compatibility for Rails 7.2
1 parent ebc6a64 commit 34d7bd4

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

.github/workflows/run_tests.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ jobs:
2828
fail-fast: false
2929
matrix:
3030
include:
31+
- gemfile: gemfiles/rails_7_2.gemfile
32+
ruby_version: '3.2'
33+
3134
- gemfile: gemfiles/rails_7_1.gemfile
3235
ruby_version: '3.2'
33-
- gemfile: gemfiles/rails_7_0.gemfile
34-
ruby_version: 2.7
3536

3637
- gemfile: gemfiles/rails_7_0.gemfile
3738
ruby_version: '3.0'

.github/workflows/run_tests_on_head.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
ruby_version: head
3131
- gemfile: gemfiles/rails_head.gemfile
3232
ruby_version: 3.2
33-
- gemfile: gemfiles/rails_7_1.gemfile
33+
- gemfile: gemfiles/rails_7_2.gemfile
3434
ruby_version: head
3535
runs-on: ubuntu-latest
3636
services:

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ task :generate_run_tests_on_head_workflow do
3838
config['jobs']['test']['strategy']['matrix']['include'] = [
3939
{'gemfile' => 'gemfiles/rails_head.gemfile', 'ruby_version' => 'head'},
4040
{'gemfile' => 'gemfiles/rails_head.gemfile', 'ruby_version' => 3.2},
41-
{'gemfile' => 'gemfiles/rails_7_1.gemfile', 'ruby_version' => 'head'},
41+
{'gemfile' => 'gemfiles/rails_7_2.gemfile', 'ruby_version' => 'head'},
4242
]
4343

4444
#

gemfiles/rails_7_2.gemfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# frozen_string_literal: true
2+
3+
source "https://rubygems.org"
4+
5+
gem "activerecord", "~> 7.2.0"
6+
gem "sqlite3", "~> 1.4.0"
7+
gem "pg", "~> 1.1"
8+
gem "mysql2", "~> 0.5" if ENV["CI"] || ENV["ALL_DB"] || ENV["DB"] == "mysql"
9+
10+
gemspec path: "../"

lib/active_record_follow_assoc/active_record_compat.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def self.parent_reflection(reflection)
8282
end
8383
end
8484

85-
if ActiveRecord.gem_version >= Gem::Version.new("4.2")
85+
if ActiveRecord.gem_version >= Gem::Version.new("4.2") && ActiveRecord.gem_version < Gem::Version.new("7.2")
8686
def self.normalize_association_name(association_name)
8787
association_name.to_s
8888
end

0 commit comments

Comments
 (0)