diff --git a/app/models/metadata_file.rb b/app/models/metadata_file.rb index b4b144e..80cefa2 100644 --- a/app/models/metadata_file.rb +++ b/app/models/metadata_file.rb @@ -16,6 +16,7 @@ class MetadataFile < MetadataTemplate def validate super + errors << I18n.t("metadata.#{type}.site_invalid") if site.invalid? errors << I18n.t("metadata.#{type}.path_required") if path_missing? errors << I18n.t("metadata.#{type}.no_file_for_description") if no_file_for_description? diff --git a/config/locales/en.yml b/config/locales/en.yml index 02570b1..94ab7e5 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -34,10 +34,12 @@ en: metadata: cant_be_empty: 'This field cannot be empty' image: + site_invalid: 'The image cannot be stored if the site configuration is not valid' not_an_image: 'Not an image' path_required: 'Missing image for upload' no_file_for_description: "There's a description with no associated image" file: + site_invalid: 'The file cannot be stored if the site configuration is not valid' path_required: "Missing file for upload" no_file_for_description: "There's a description with no associated file" event: diff --git a/config/locales/es.yml b/config/locales/es.yml index 5bb4a22..6d84d7e 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -34,10 +34,12 @@ es: metadata: cant_be_empty: 'El campo no puede estar vacío' image: + site_invalid: 'La imagen no se puede almacenar si la configuración del sitio no es válida' not_an_image: 'No es una imagen' path_required: 'Se necesita una imagen' no_file_for_description: 'Se envió una descripción sin imagen asociada' file: + site_invalid: 'El archivo no se puede almacenar si la configuración del sitio no es válida' path_required: 'Se necesita un archivo' no_file_for_description: 'se envió una descripción sin archivo asociado' event: