5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-23 06:56:22 +00:00

Merge branch 'jekyll-service' into panel.sutty.nl
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
f 2022-11-28 19:33:05 -03:00
commit 220ba7e39e

View file

@ -23,7 +23,6 @@ class MetadataFile < MetadataTemplate
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?
errors << I18n.t("metadata.#{type}.attachment_missing") if path? && !static_file
errors.compact!
@ -43,8 +42,12 @@ class MetadataFile < MetadataTemplate
# Asociar la imagen subida al sitio y obtener la ruta
# @return [Boolean]
def save
value['description'] = sanitize value['description']
value['path'] = relative_destination_path_with_filename.to_s if static_file
if value['path'].blank?
self[:value] = default_value
else
value['description'] = sanitize value['description']
value['path'] = relative_destination_path_with_filename.to_s if static_file
end
true
end
@ -134,11 +137,6 @@ class MetadataFile < MetadataTemplate
end
end
# No hay archivo pero se lo describió
def no_file_for_description?
!path? && description?
end
# Obtiene el id del blob asociado
#
# @return [Integer,nil]