Class: SupportingEvidenceAttachmentUploader
- Inherits:
-
EVSSClaimDocumentUploaderBase
- Object
- CarrierWave::Uploader::Base
- EVSSClaimDocumentUploaderBase
- SupportingEvidenceAttachmentUploader
- Defined in:
- app/uploaders/supporting_evidence_attachment_uploader.rb
Overview
Files uploaded as part of a form526 submission that will be sent to EVSS upon form submission.
Instance Method Summary collapse
-
#initialize(guid, _unused = nil) ⇒ SupportingEvidenceAttachmentUploader
constructor
A new instance of SupportingEvidenceAttachmentUploader.
- #log_transaction_complete(uploaded_file = nil) ⇒ Object
- #log_transaction_start(uploaded_file = nil) ⇒ Object
- #store_dir ⇒ Object
Methods inherited from EVSSClaimDocumentUploaderBase
#extension_allowlist, #max_file_size_non_pdf, #size_range, #validate_file_size
Methods included from ConvertFileType
#converted_exists?, #final_filename, #read_for_upload, #tiff?, #tiff_or_incorrect_extension?
Methods included from ValidatePdf
Methods included from SetAWSConfig
Constructor Details
#initialize(guid, _unused = nil) ⇒ SupportingEvidenceAttachmentUploader
Returns a new instance of SupportingEvidenceAttachmentUploader.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/uploaders/supporting_evidence_attachment_uploader.rb', line 8 def initialize(guid, _unused = nil) # carrierwave allows only 2 arguments, which they will pass onto # different versions by calling the initialize function again # so the _unused argument is necessary super @guid = guid # defaults to CarrierWave::Storage::File if not AWS if Rails.env.production? set_aws_config( Settings.evss.s3.aws_access_key_id, Settings.evss.s3.aws_secret_access_key, Settings.evss.s3.region, Settings.evss.s3.bucket ) end end |
Instance Method Details
#log_transaction_complete(uploaded_file = nil) ⇒ Object
44 45 46 47 48 49 50 51 52 53 |
# File 'app/uploaders/supporting_evidence_attachment_uploader.rb', line 44 def log_transaction_complete(uploaded_file = nil) log = { process_id: Process.pid, filesize: uploaded_file.try(:size), file_headers: uploaded_file.try(:headers), upload_complete: Time.current } Rails.logger.info(log) end |
#log_transaction_start(uploaded_file = nil) ⇒ Object
33 34 35 36 37 38 39 40 41 42 |
# File 'app/uploaders/supporting_evidence_attachment_uploader.rb', line 33 def log_transaction_start(uploaded_file = nil) log = { process_id: Process.pid, filesize: uploaded_file.try(:size), file_headers: uploaded_file.try(:headers), upload_start: Time.current } Rails.logger.info(log) end |
#store_dir ⇒ Object
27 28 29 30 31 |
# File 'app/uploaders/supporting_evidence_attachment_uploader.rb', line 27 def store_dir raise 'missing guid' if @guid.blank? "disability_compensation_supporting_form/#{@guid}" end |