demarches-normaliennes/app/models/attestation.rb
Simon Lehericey e60ce35ae8 [Fix #196] Attestation: join the attestation to the closed mail
Add a upper limit to the attachment size as it could be a problem with Mailjet and receiver
(https://www.mailjet.com/support/what-is-the-size-limit-for-attachments-files-sent-via-mailjet,289.htm)

If the attestation cannot be sent, it is logged in sentry
2017-06-16 12:11:10 +02:00

11 lines
203 B
Ruby

class Attestation < ApplicationRecord
belongs_to :dossier
mount_uploader :pdf, AttestationUploader
MAX_SIZE_EMAILABLE = 2.megabytes
def emailable?
pdf.size <= MAX_SIZE_EMAILABLE
end
end