5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-24 12:46:22 +00:00
panel/app/models/metadata_image.rb
f 48b703cf06
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
test: testear subida de imagenes #14433
2023-10-09 14:25:32 -03:00

22 lines
379 B
Ruby

# frozen_string_literal: true
# Define un campo de imagen
class MetadataImage < MetadataFile
def validate
super
errors << I18n.t('metadata.image.not_an_image') if path? && !image?
errors.compact!
errors.empty?
end
private
# Determina si es una imagen para web
#
# @return [Boolean]
def image?
static_file&.blob&.send(:web_image?)
end
end