e60ce35ae8
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
11 lines
203 B
Ruby
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
|