5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-16 19:36:22 +00:00

validaciones

This commit is contained in:
f 2022-03-07 20:52:33 -03:00
parent f7d8a3ecf9
commit 81cbafef66
2 changed files with 2 additions and 2 deletions

View file

@ -19,7 +19,7 @@ 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}.no_file_for_description") if no_file_for_description?
errors << I18n.t("metadata.#{type}.attachment_missing") unless static_file errors << I18n.t("metadata.#{type}.attachment_missing") if path? && !static_file
errors.compact! errors.compact!
errors.empty? errors.empty?

View file

@ -5,7 +5,7 @@ class MetadataImage < MetadataFile
def validate def validate
super super
errors << I18n.t('metadata.image.not_an_image') unless image? errors << I18n.t('metadata.image.not_an_image') unless path? && image?
errors.compact! errors.compact!
errors.empty? errors.empty?