mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-25 12:56:21 +00:00
fix: no modificar la relación si ya estaba deshecha
This commit is contained in:
parent
23c9c7dc0d
commit
7ebc171cab
1 changed files with 3 additions and 0 deletions
|
@ -42,6 +42,9 @@ class MetadataHasMany < MetadataRelatedPosts
|
||||||
return true unless inverse?
|
return true unless inverse?
|
||||||
|
|
||||||
(had_many - has_many).each do |remove|
|
(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
|
remove[inverse]&.value = remove[inverse].default_value
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue