From 0401834a4442e45732c8513ebcb47d2355dc4c4e Mon Sep 17 00:00:00 2001 From: Paul Bob Date: Thu, 16 Nov 2023 14:33:26 +0200 Subject: [PATCH] fix: detach should not destroy attachment --- app/controllers/avo/associations_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/avo/associations_controller.rb b/app/controllers/avo/associations_controller.rb index fd66776d22..698b9a2597 100644 --- a/app/controllers/avo/associations_controller.rb +++ b/app/controllers/avo/associations_controller.rb @@ -81,7 +81,7 @@ def destroy association_name = BaseResource.valid_association_name(@model, params[:related_name]) if reflection_class == "HasManyReflection" - @model.send(association_name).destroy @attachment_model + @model.send(association_name).delete @attachment_model else @model.send("#{association_name}=", nil) end