Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActiveSupport::Deprecation#warn no longer works on Rails 7.2 #573

Open
caius opened this issue Jan 15, 2025 · 0 comments
Open

ActiveSupport::Deprecation#warn no longer works on Rails 7.2 #573

caius opened this issue Jan 15, 2025 · 0 comments

Comments

@caius
Copy link

caius commented Jan 15, 2025

If you invoke Model.restore(instance) then paranoia finds the id from the instances for you and issues a deprecation warning at https://github.com/rubysherpas/paranoia/blob/core/lib/paranoia.rb#L50-L54

In Rails 7 they've added specific ActiveSupport::Deprecator instances to be used instead of a generic .warn method, and by Rails 7.2 the ActiveSupport::Deprecation.warn method has been undefined so we get a NoMethodError when passing a record rather than the code working and a deprecation warning being emitted.

We should update the behaviour in paranoia to work out if we're on a new enough rails (probably check for presence of ActiveSupport::Deprecation.method(:warn)?) to use the Deprecator instances and create one for the Paranoia gem rather than using the generic .warn across the app in the earlier Railses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant