-
Notifications
You must be signed in to change notification settings - Fork 528
Description
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.