Skip to content

Commit 0e090e9

Browse files
authored
Merge pull request #78 from eikes/rails-7-1
Adds rails-7-1 support
2 parents 654de96 + 985a6c3 commit 0e090e9

4 files changed

Lines changed: 29 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ on: [push, pull_request]
55
jobs:
66
test:
77
name: 'Ruby: ${{ matrix.ruby }}, Rails: ${{ matrix.rails }}'
8-
runs-on: 'ubuntu-20.04'
8+
runs-on: 'ubuntu-22.04'
99
strategy:
1010
fail-fast: false
1111
matrix:
1212
ruby: ['3.2', '3.1', '3.0', '2.7', '2.6', '2.5']
13-
rails: ['5.1', '5.2', '6.0', '6.1', '7.0']
13+
rails: ['5.1', '5.2', '6.0', '6.1', '7.0', '7.1']
1414
exclude:
1515
- ruby: '3.2'
1616
rails: '5.1'
@@ -34,6 +34,10 @@ jobs:
3434
rails: '7.0'
3535
- ruby: '2.5'
3636
rails: '7.0'
37+
- ruby: '2.5'
38+
rails: '7.1'
39+
- ruby: '2.6'
40+
rails: '7.1'
3741
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
3842
BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails }}.gemfile
3943
steps:
@@ -43,6 +47,7 @@ jobs:
4347
with:
4448
ruby-version: ${{ matrix.ruby }}
4549
bundler-cache: true # 'bundle install' and cache
50+
rubygems: ${{ matrix.ruby == '2.5' && 'default' || 'latest' }}
4651
- name: Copy config file
4752
run: cp spec/support/sample.config.yml spec/support/config.yml
4853
- name: Run tests

Appraisals

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ end
1717
appraise "rails-7.0" do
1818
gem "rails", "~> 7.0.0"
1919
end
20+
21+
appraise "rails-7.1" do
22+
gem "rails", "~> 7.1.0"
23+
end

gemfiles/rails_7.1.gemfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "database_cleaner-core", git: "https://github.com/DatabaseCleaner/database_cleaner"
6+
gem "rails", github: 'rails/rails' # "~> 7.1.0"
7+
8+
group :test do
9+
gem "simplecov", require: false
10+
gem "codecov", require: false
11+
end
12+
13+
gemspec path: "../"

lib/database_cleaner/active_record/base.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ def self.config_file_location
1515

1616
class Base < DatabaseCleaner::Strategy
1717
def self.migration_table_name
18-
::ActiveRecord::SchemaMigration.table_name
18+
if Gem::Version.new("6.0.0") <= ::ActiveRecord.version
19+
::ActiveRecord::Base.connection.schema_migration.table_name
20+
else
21+
::ActiveRecord::SchemaMigration.table_name
22+
end
1923
end
2024

2125
def self.exclusion_condition(column_name)

0 commit comments

Comments
 (0)