mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 09:31:41 +00:00
fix: commitear el cambio de nombre de archivo #2183
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
6ff0a36b44
commit
63620b2d09
1 changed files with 5 additions and 1 deletions
|
@ -42,9 +42,13 @@ PostService = Struct.new(:site, :usuarie, :post, :params, keyword_init: true) do
|
|||
post.usuaries << usuarie
|
||||
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?
|
||||
|
||||
# Es importante que el artículo se guarde primero y luego los
|
||||
# relacionados.
|
||||
commit(action: :updated, add: update_related_posts) if post.update(post_params)
|
||||
commit(action: :updated, add: update_related_posts, rm: rm) if post.update(post_params)
|
||||
|
||||
update_site_license!
|
||||
|
||||
|
|
Loading…
Reference in a new issue