From 82e676e16106d7679893b5dcfae1e7deef082ab1 Mon Sep 17 00:00:00 2001 From: f Date: Tue, 11 Aug 2020 10:06:23 -0300 Subject: [PATCH] siempre devolver la ruta completa al archivo --- app/models/metadata_file.rb | 5 ++++- config/locales/en.yml | 2 ++ config/locales/es.yml | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/models/metadata_file.rb b/app/models/metadata_file.rb index 80a934c..f27d7a9 100644 --- a/app/models/metadata_file.rb +++ b/app/models/metadata_file.rb @@ -78,11 +78,14 @@ class MetadataFile < MetadataTemplate @path ||= Pathname.new value['path'] end + # Obtiene la ruta absoluta del archivo + # + # @return [String] def file if value['path'].is_a? ActionDispatch::Http::UploadedFile value['path'].tempfile.path else - value['path'] + File.join site.path, value['path'] end end diff --git a/config/locales/en.yml b/config/locales/en.yml index 553a247..221cb55 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -439,6 +439,8 @@ en: locales: mapable: help: You can link to the article's translation by looking up its title here and pressing Add + image: + label: Imagen reorder: 'Reorder posts' sort: by: 'Sort by' diff --git a/config/locales/es.yml b/config/locales/es.yml index 1dfbd7f..b3b772f 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -448,6 +448,8 @@ es: locales: mapable: help: Puedes vincular traducciones buscando el título aquí y presionando Agregar + image: + label: Imagen reorder: 'Reordenar artículos' sort: by: 'Ordenar por'