From 5f8705a4c0dfafc93aeaf00abcb90311fb6592b5 Mon Sep 17 00:00:00 2001 From: Larry Gebhardt Date: Thu, 30 Aug 2018 15:18:00 -0400 Subject: [PATCH] Use `destroy` instead of `delete` to ensure callbacks are called (cherry picked from commit 565d4b6) --- lib/jsonapi/resource.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jsonapi/resource.rb b/lib/jsonapi/resource.rb index 6710b3eb1..2add5dd62 100644 --- a/lib/jsonapi/resource.rb +++ b/lib/jsonapi/resource.rb @@ -352,7 +352,7 @@ def _remove_to_many_link(relationship_type, key, options) @reload_needed = true else - @model.public_send(relationship.relation_name(context: @context)).delete(key) + @model.public_send(relationship.relation_name(context: @context)).destroy(key) end :completed