DatabaseCleaner / database_cleaner-active_record

Strategies for cleaning databases using ActiveRecord. Can be used to ensure a clean state for testing.
MIT License
64 stars 63 forks source link

use ActiveRecord::Base.connection.schema_migration.table_name instead ActiveRecord::SchemaMigration.table_name for Rails 7.1 more #75

Closed QWYNG closed 1 year ago

QWYNG commented 2 years ago

fix https://github.com/DatabaseCleaner/database_cleaner-active_record/issues/83

In ActiveRecord 7.1, ActiveRecord::SchemaMigration.table_name being removed. As noted here, we will access it with ActiveRecord::Base.connection.schema_migration.table_name instead

jturkel commented 2 years ago

I was working on a similar fix in https://github.com/DatabaseCleaner/database_cleaner-active_record/compare/main...jturkel:database_cleaner-active_record:fix-rails-edge. Not sure if the maintainers of this project are interested in adding Rails Edge to the CI matrix.

QWYNG commented 1 year ago

Hi @etagwerker, Could you please check this PR? I have seen some repositories with failed tests.

https://github.com/kufu/activerecord-bitemporal/pull/105 https://github.com/rootstrap/yaaf/pull/83

etagwerker commented 1 year ago

@QWYNG Thanks for taking a stab at this! I decided to go with this solution: https://github.com/DatabaseCleaner/database_cleaner-active_record/pull/78