You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to .destroy or .destroy_all record(s) without delete the ActiveStorage association?
Example: product = Product.last with 2 images attached
It would be great for this behavior to work product.destroy(keep_storage: true) product.images.count -> 2
Current behavior: product.images.count -> 0
Expected behavior: product.images.count -> 2
The text was updated successfully, but these errors were encountered:
pierry01
changed the title
Does not destroy ActiveStorage
Does not destroy ActiveStorage associations
Jun 17, 2022
mvz
changed the title
Does not destroy ActiveStorage associations
How can I destroy models without destroying their ActiveStorage associations?
Jun 18, 2022
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
-> 0Expected behavior:
product.images.count
-> 2The text was updated successfully, but these errors were encountered: