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

v2.0.1 is throwing deprecation warning for using #tables instead of #data_sources #84

Closed EduardoRSeifert closed 1 year ago

EduardoRSeifert commented 2 years ago

DEPRECATION WARNING: #tables currently returns both tables and views. This behavior is deprecated and will be changed with Rails 5.1 to only return tables. Use #data_sources instead.

This is being thrown when i run DatabaseCleaner.clean_with(:truncation)

After some searching, i found 2 PRs that fixed this and were merged onto master, PR1 PR2, but it seems like these fixes got lost somewhere.

I used git bisect to find which commit broke and it may have been this one, b83ed7d1e39c16ccd54342f37f4d1094366bc579 , but i do admit that i narrowed my search to what commit broke it on the database_cleaner gem, not on database_cleaner-active_record gem, so i am not sure

Marinofull commented 2 years ago

Dear maintainers, which versions of Rails is this and Database_cleaner-active_record supposed to support? I'm thinking of opening a PR to that repository making it handling this data_sources/ tables situation again. But it is good to understand what are the intended versions to be supported before any suggestion

etagwerker commented 1 year ago

@Marinofull That is a good question. I don't think we ever defined a support policy.

I believe we should follow Rails' maintenance policy: https://guides.rubyonrails.org/maintenance_policy.html

If there are any issues with unmaintained versions of Rails I don't see why we should offer support for that.

etagwerker commented 1 year ago

I believe this is now fixed on https://github.com/DatabaseCleaner/database_cleaner-active_record/blob/main/CHANGELOG.md#v210-2023-02-17