amatsuda / database_rewinder

minimalist's tiny and ultra-fast database cleaner
MIT License
806 stars 92 forks source link

[WIP] Support for hidden databases (Rails 7) #89

Open schmijos opened 8 months ago

schmijos commented 8 months ago

ActiveRecord::Base.configurations.configs_for (Rails 7.0, Rails 7.1) knows two kind of hidden database configurations: replica: true and database_tasks: false.

It was unexpected for me to find out that DatabaseRewinder doesn't consider the readonly database I have in my project. Because when testing I still insert fakes and expect them to be rewinded.

I added two tests to the suite to pinpoint the problem. But I'm not sure what a good solution would actually be. Maybe a hint in the docs about how database_tasks: false will affect your upgrade path to Rails 7 when using DatabaseRewinder would be enough?