mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-23 14:06:22 +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}.site_invalid") if site.invalid?
|
||||||
errors << I18n.t("metadata.#{type}.path_required") if path_missing?
|
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 << I18n.t("metadata.#{type}.attachment_missing") if path? && !static_file
|
||||||
|
|
||||||
errors.compact!
|
errors.compact!
|
||||||
|
@ -43,8 +42,12 @@ class MetadataFile < MetadataTemplate
|
||||||
# Asociar la imagen subida al sitio y obtener la ruta
|
# Asociar la imagen subida al sitio y obtener la ruta
|
||||||
# @return [Boolean]
|
# @return [Boolean]
|
||||||
def save
|
def save
|
||||||
|
if value['path'].blank?
|
||||||
|
self[:value] = default_value
|
||||||
|
else
|
||||||
value['description'] = sanitize value['description']
|
value['description'] = sanitize value['description']
|
||||||
value['path'] = relative_destination_path_with_filename.to_s if static_file
|
value['path'] = relative_destination_path_with_filename.to_s if static_file
|
||||||
|
end
|
||||||
|
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
@ -134,11 +137,6 @@ class MetadataFile < MetadataTemplate
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# No hay archivo pero se lo describió
|
|
||||||
def no_file_for_description?
|
|
||||||
!path? && description?
|
|
||||||
end
|
|
||||||
|
|
||||||
# Obtiene el id del blob asociado
|
# Obtiene el id del blob asociado
|
||||||
#
|
#
|
||||||
# @return [Integer,nil]
|
# @return [Integer,nil]
|
||||||
|
|
Loading…
Reference in a new issue