Recovering Records with acts_as_paranoid and shrine

Hi everyone,

I am fairly new to ruby/rails. I implemented acts_as_paranoid gem to my application, along with Shrine.

After soft deleting a record, shrine automatically deletes related images connected to record. But since my records are recoverable, cant recover images removed by shrine.

Only solution i found is disabling callbacks, but i believe it can can cause other problems (like validation etc). https://shrinerb.com/docs/plugins/activerecord#skipping-callbacks

Has anyone had similar problem like this, any solutions? Is there any way to disabling only one callback (after_destory maybe)?

I’ve had this same problem in other attachment libraries. The solution in Shrine is really easy – there’s a plugin named something like “keep deleted files”, and it does what it says on the tin. This was a lot harder to solve with Paperclip, IIRC.

Walter

Thank you. keep_files plugin solved my problem.