diff --git a/lib/database_cleaner/active_record/base.rb b/lib/database_cleaner/active_record/base.rb index ed61045f..b60f3eea 100644 --- a/lib/database_cleaner/active_record/base.rb +++ b/lib/database_cleaner/active_record/base.rb @@ -15,7 +15,9 @@ def self.config_file_location class Base < DatabaseCleaner::Strategy def self.migration_table_name - if Gem::Version.new("6.0.0") <= ::ActiveRecord.version + if Gem::Version.new("7.1.0") < ::ActiveRecord.version + ::ActiveRecord::Base.connection_pool.schema_migration.table_name + elsif Gem::Version.new("6.0.0") <= ::ActiveRecord.version ::ActiveRecord::Base.connection.schema_migration.table_name else ::ActiveRecord::SchemaMigration.table_name