mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-24 19:16:23 +00:00
Merge branch 'jekyll-service' into panel.sutty.nl
This commit is contained in:
commit
121ccbf42e
2 changed files with 6 additions and 2 deletions
|
@ -67,7 +67,9 @@ module ActiveStorage
|
|||
# @param :key [String]
|
||||
# @return [String]
|
||||
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
|
||||
|
||||
# Crea una ruta para la llave con un nombre conocido.
|
||||
|
|
|
@ -124,13 +124,15 @@ class MetadataFile < MetadataTemplate
|
|||
# devolvemos la ruta original, que puede ser el archivo que no existe
|
||||
# o vacía si se está subiendo uno.
|
||||
rescue Errno::ENOENT => e
|
||||
ExceptionNotifier.notify_exception(e)
|
||||
ExceptionNotifier.notify_exception(e, data: { site: site.name, path: value['path'] })
|
||||
|
||||
Pathname.new(value['path'])
|
||||
end
|
||||
|
||||
def relative_destination_path_with_filename
|
||||
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
|
||||
|
||||
def static_file_path
|
||||
|
|
Loading…
Reference in a new issue