Skip to content

Commit

Permalink
Support Rails 7.2+ (#101)
Browse files Browse the repository at this point in the history
* Support Rails 7.2+

* Update lib/database_cleaner/active_record/base.rb

Co-authored-by: Jean byroot Boussier <[email protected]>

---------

Co-authored-by: Jean byroot Boussier <[email protected]>
  • Loading branch information
ghiculescu and casperisfine authored Jun 5, 2024
1 parent 644a218 commit 74a913a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/database_cleaner/active_record/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 74a913a

Please sign in to comment.