Open pierry01 opened 2 years ago
Hi @pierry01 I edited your title a bit because it seemed to be saying the opposite of the body of your issue. Let me know if I misunderstood somehow.
@mvz sorry for the delay. The title is correct now, thanks!!!
You understood the problem. Does it make sense to implement a solution for this?
@pierry01 I think the associations should always be kept until the model is fully destroyed. See also the discussion in #103.
Is there any solution for keeping ActiveStorage attachments?
Hello everyone!
Is there a way to
.destroy
or.destroy_all
record(s) without delete the ActiveStorage association? Example:product = Product.last
with2 images
attachedproduct.destroy
product.deleted_at
->Time.current
It would be great for this behavior to work
product.destroy(keep_storage: true)
product.images.count
-> 2Current behavior:
product.images.count
-> 0 Expected behavior:product.images.count
-> 2