Skip to content

Commit 74a913a

Browse files
Support Rails 7.2+ (#101)
* Support Rails 7.2+ * Update lib/database_cleaner/active_record/base.rb Co-authored-by: Jean byroot Boussier <jean.boussier+github@shopify.com> --------- Co-authored-by: Jean byroot Boussier <jean.boussier+github@shopify.com>
1 parent 644a218 commit 74a913a

File tree

1 file changed

+3
-1
lines changed
  • lib/database_cleaner/active_record

1 file changed

+3
-1
lines changed

lib/database_cleaner/active_record/base.rb

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

1616
class Base < DatabaseCleaner::Strategy
1717
def self.migration_table_name
18-
if Gem::Version.new("6.0.0") <= ::ActiveRecord.version
18+
if Gem::Version.new("7.1.0") < ::ActiveRecord.version
19+
::ActiveRecord::Base.connection_pool.schema_migration.table_name
20+
elsif Gem::Version.new("6.0.0") <= ::ActiveRecord.version
1921
::ActiveRecord::Base.connection.schema_migration.table_name
2022
else
2123
::ActiveRecord::SchemaMigration.table_name

0 commit comments

Comments
 (0)