mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 06:41:41 +00:00
fix: primero hay que modificar los datos
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
63620b2d09
commit
f05830c646
1 changed files with 8 additions and 6 deletions
|
@ -43,14 +43,16 @@ PostService = Struct.new(:site, :usuarie, :post, :params, keyword_init: true) do
|
|||
params[:post][:draft] = true if site.invitade? usuarie
|
||||
|
||||
# Eliminar ("mover") el archivo si cambió de ubicación.
|
||||
rm = []
|
||||
rm << post.path.value_was if post.path.changed?
|
||||
if post.update(post_params)
|
||||
rm = []
|
||||
rm << post.path.value_was if post.path.changed?
|
||||
|
||||
# Es importante que el artículo se guarde primero y luego los
|
||||
# relacionados.
|
||||
commit(action: :updated, add: update_related_posts, rm: rm) if post.update(post_params)
|
||||
# Es importante que el artículo se guarde primero y luego los
|
||||
# relacionados.
|
||||
commit(action: :updated, add: update_related_posts, rm: rm)
|
||||
|
||||
update_site_license!
|
||||
update_site_license!
|
||||
end
|
||||
|
||||
# Devolver el post aunque no se haya salvado para poder rescatar los
|
||||
# errores
|
||||
|
|
Loading…
Reference in a new issue