From 7ebc171cabd1c2589d10f024cae03094c9eaafad Mon Sep 17 00:00:00 2001 From: f Date: Wed, 23 Oct 2024 15:24:16 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20no=20modificar=20la=20relaci=C3=B3n=20si?= =?UTF-8?q?=20ya=20estaba=20deshecha?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/metadata_has_many.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/models/metadata_has_many.rb b/app/models/metadata_has_many.rb index b4db4454..a15f1241 100644 --- a/app/models/metadata_has_many.rb +++ b/app/models/metadata_has_many.rb @@ -42,6 +42,9 @@ class MetadataHasMany < MetadataRelatedPosts return true unless inverse? (had_many - has_many).each do |remove| + # No modificar nada si la relaciĆ³n ya estaba deshecha + next unless remove[inverse]&.value == post.uuid.value + remove[inverse]&.value = remove[inverse].default_value end