Hey guys! I don't know if you still accept new features or just maintain the gem but there's behaviour that could be slightly modified.
The default behaviour in AR is to return the entire object that was destroyed, see the screenshot below.
When a model includes Paperclip, unfortunately, its attributes are gone when the destroyed object is returned. It's a bit confusing, especially when tracking object changes.
This PR introduces a way to keep the attributes being returned after destroying the record. By default, it doesn't change the original behaviour, but after setting hide_attrs_to_be_destroyed to false within the model, we can see what file data the record had. It works only for the destroy callback, so no changes when we update the file/assign nil.
Hey guys! I don't know if you still accept new features or just maintain the gem but there's behaviour that could be slightly modified.
The default behaviour in AR is to return the entire object that was destroyed, see the screenshot below.
When a model includes Paperclip, unfortunately, its attributes are gone when the destroyed object is returned. It's a bit confusing, especially when tracking object changes.
This PR introduces a way to keep the attributes being returned after destroying the record. By default, it doesn't change the original behaviour, but after setting
hide_attrs_to_be_destroyed
tofalse
within the model, we can see what file data the record had. It works only for thedestroy
callback, so no changes when we update the file/assignnil
.