mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 18:56:21 +00:00
informar cuando el nombre de archivo está vacío
This commit is contained in:
parent
cd523babad
commit
aab8ed9fed
1 changed files with 3 additions and 1 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.
|
||||
|
|
Loading…
Reference in a new issue