mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-23 11:16:23 +00:00
Merge branch 'jekyll-service' into panel.sutty.nl
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
commit
220ba7e39e
1 changed files with 6 additions and 8 deletions
|
@ -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
|
||||
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]
|
||||
|
|
Loading…
Reference in a new issue