Skip to content

Commit

Permalink
fix: detach should not destroy attachment (#2034)
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Bob committed Nov 20, 2023
1 parent e07ad43 commit 43aca11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/avo/associations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 43aca11

Please sign in to comment.