5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-24 19:46:23 +00:00

Merge branch 'jekyll-service' into panel.sutty.nl

This commit is contained in:
f 2022-07-13 14:21:49 -03:00
commit 121ccbf42e
2 changed files with 6 additions and 2 deletions

View file

@ -67,7 +67,9 @@ module ActiveStorage
# @param :key [String] # @param :key [String]
# @return [String] # @return [String]
def filename_for(key) def filename_for(key)
ActiveStorage::Blob.where(key: key).limit(1).pluck(:filename).first ActiveStorage::Blob.where(key: key).limit(1).pluck(:filename).first.tap do |filename|
raise ArgumentError, "Filename for key #{key} is blank" if filename.blank?
end
end end
# Crea una ruta para la llave con un nombre conocido. # Crea una ruta para la llave con un nombre conocido.

View file

@ -124,13 +124,15 @@ class MetadataFile < MetadataTemplate
# devolvemos la ruta original, que puede ser el archivo que no existe # devolvemos la ruta original, que puede ser el archivo que no existe
# o vacía si se está subiendo uno. # o vacía si se está subiendo uno.
rescue Errno::ENOENT => e rescue Errno::ENOENT => e
ExceptionNotifier.notify_exception(e) ExceptionNotifier.notify_exception(e, data: { site: site.name, path: value['path'] })
Pathname.new(value['path']) Pathname.new(value['path'])
end end
def relative_destination_path_with_filename def relative_destination_path_with_filename
destination_path_with_filename.relative_path_from(Pathname.new(site.path).realpath) destination_path_with_filename.relative_path_from(Pathname.new(site.path).realpath)
rescue ArgumentError => e
ExceptionNotifier.notify_exception(e, data: { site: site.name, path: value['path'] })
end end
def static_file_path def static_file_path