5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-16 22:36:21 +00:00
panel/app/models/metadata_image.rb
2022-03-08 13:21:13 -03:00

18 lines
333 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
# Determina si es una imagen
def image?
static_file&.blob&.send(:web_image?)
end
end