mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-24 12:46:22 +00:00
22 lines
379 B
Ruby
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
|