demarches-normaliennes/app/models/concerns/blob_image_processor_concern.rb

28 lines
594 B
Ruby
Raw Normal View History

2024-04-29 16:53:21 +02:00
module BlobImageProcessorConcern
def watermark_pending?
watermark_required? && !watermark_done?
end
def watermark_done?
watermarked_at.present?
2020-11-17 16:34:24 +01:00
end
2024-05-07 16:41:20 +02:00
def representation_required?
from_champ? || from_messagerie?
2020-11-17 16:34:24 +01:00
end
private
def from_champ?
attachments.any? { _1.record.class == Champs::TitreIdentiteChamp || _1.record.class == Champs::PieceJustificativeChamp }
end
def from_messagerie?
attachments.any? { _1.record.class == Commentaire }
end
def watermark_required?
attachments.any? { _1.record.class == Champs::TitreIdentiteChamp }
end
2020-11-17 16:34:24 +01:00
end