5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-07-03 00:26:08 +00:00

no cambiar el valor si no se pudo cargar el archivo

esto hace que sutilmente desaparezcan archivos
This commit is contained in:
f 2022-07-12 15:38:16 -03:00
parent eb1c12e362
commit 9e531e4995

View file

@ -41,14 +41,10 @@ class MetadataFile < MetadataTemplate
end
# Asociar la imagen subida al sitio y obtener la ruta
#
# XXX: Si evitamos guardar cambios con changed? no tenemos forma de
# saber que un archivo subido manualmente se convirtió en
# un Attachment y cada vez que lo editemos vamos a subir una imagen
# repetida.
# @return [Boolean]
def save
value['description'] = sanitize value['description']
value['path'] = static_file ? relative_destination_path_with_filename.to_s : nil
value['path'] = relative_destination_path_with_filename.to_s if static_file
true
end