5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-26 17:16:23 +00:00

Merge branch 'issue-15068' into production.panel.sutty.nl

This commit is contained in:
f 2024-10-23 15:25:23 -03:00
commit f4162fcccb
No known key found for this signature in database
3 changed files with 6 additions and 2 deletions

View file

@ -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

View file

@ -75,6 +75,7 @@
Enviamos valores vacíos o arrastrados desde el formulario anterior Enviamos valores vacíos o arrastrados desde el formulario anterior
para los atributos ignorados para los atributos ignorados
- except.each do |attr| - except.each do |attr|
%input{ type: 'hidden', name: "#{base}[#{attr}]", value: pluck_param(attr, optional: true) } - if (value = pluck_param(attr, optional: true)).present?
%input{ type: 'hidden', name: "#{base}[#{attr}]", value: value }
= yield(:post_form) = yield(:post_form)

View file

@ -59,7 +59,7 @@
= render 'posts/attributes', site: site, post: post, dir: dir, base: base, locale: locale, except: except = render 'posts/attributes', site: site, post: post, dir: dir, base: base, locale: locale, except: except
-# @todo Volver obligatorios? -# @todo Volver obligatorios?
- except.each do |attr| - except.each do |attr|
- if (value = pluck_param(attr, optional: true)) - if (value = pluck_param(attr, optional: true)).present?
= hidden_field_tag "#{base}[#{attr}]", value = hidden_field_tag "#{base}[#{attr}]", value
- content_for :"#{modal_id}_footer" do - content_for :"#{modal_id}_footer" do