Class: EVSSClaimDocumentUploaderBase
- Inherits:
-
CarrierWave::Uploader::Base
- Object
- CarrierWave::Uploader::Base
- EVSSClaimDocumentUploaderBase
- Includes:
- CarrierWave::MiniMagick, ConvertFileType, SetAWSConfig, ValidatePdf
- Defined in:
- app/uploaders/evss_claim_document_uploader_base.rb
Direct Known Subclasses
EVSSClaimDocumentUploader, SupportingEvidenceAttachmentUploader
Instance Method Summary collapse
- #extension_allowlist ⇒ Object
- #max_file_size_non_pdf ⇒ Object
- #size_range ⇒ Object
-
#validate_file_size(file) ⇒ Object
EVSS will split PDF’s larger than 50mb before sending to VBA who has a limit of 50mb.
Methods included from ConvertFileType
#converted_exists?, #final_filename, #read_for_upload, #tiff?, #tiff_or_incorrect_extension?
Methods included from ValidatePdf
Methods included from SetAWSConfig
Instance Method Details
#extension_allowlist ⇒ Object
29 30 31 |
# File 'app/uploaders/evss_claim_document_uploader_base.rb', line 29 def extension_allowlist %w[pdf gif png tiff tif jpeg jpg bmp txt] end |
#max_file_size_non_pdf ⇒ Object
33 34 35 |
# File 'app/uploaders/evss_claim_document_uploader_base.rb', line 33 def max_file_size_non_pdf 50.megabytes end |
#size_range ⇒ Object
25 26 27 |
# File 'app/uploaders/evss_claim_document_uploader_base.rb', line 25 def size_range 1.byte...99.megabytes end |
#validate_file_size(file) ⇒ Object
EVSS will split PDF’s larger than 50mb before sending to VBA who has a limit of 50mb. so, PDF’s can be larger than other files
39 40 41 42 43 44 |
# File 'app/uploaders/evss_claim_document_uploader_base.rb', line 39 def validate_file_size(file) if file.content_type != 'application/pdf' && file.size > max_file_size_non_pdf raise CarrierWave::IntegrityError, I18n.t(:'errors.messages.max_size_error', max_size: '50MB') end end |