mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 15:06:22 +00:00
fix: verificar que haya una relación #13005
This commit is contained in:
parent
e8c659be83
commit
9ed22fb065
1 changed files with 6 additions and 4 deletions
|
@ -50,10 +50,12 @@ class MetadataBelongsTo < MetadataRelatedPosts
|
||||||
end
|
end
|
||||||
|
|
||||||
# No duplicar las relaciones
|
# No duplicar las relaciones
|
||||||
if belongs_to[inverse].respond_to? :has_one
|
if belongs_to.present?
|
||||||
belongs_to[inverse].value = post.uuid.value
|
if belongs_to[inverse].respond_to? :has_one
|
||||||
else
|
belongs_to[inverse].value = post.uuid.value
|
||||||
belongs_to[inverse].value = (belongs_to[inverse].value.dup << post.uuid.value) unless belongs_to.blank? || included?
|
else
|
||||||
|
belongs_to[inverse].value = (belongs_to[inverse].value.dup << post.uuid.value) unless belongs_to.blank? || included?
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
true
|
true
|
||||||
|
|
Loading…
Reference in a new issue