Class: SupportingEvidenceAttachment
- Inherits:
-
FormAttachment
- Object
- ActiveRecord::Base
- ApplicationRecord
- FormAttachment
- SupportingEvidenceAttachment
- Defined in:
- app/models/supporting_evidence_attachment.rb
Overview
Files uploaded as part of a form526 submission that will be sent to EVSS upon form submission. inherits from ApplicationRecord
Constant Summary collapse
- ATTACHMENT_UPLOADER_CLASS =
SupportingEvidenceAttachmentUploader
Instance Method Summary collapse
- #converted_filename ⇒ Object
-
#set_file_data!(file, file_password = nil) ⇒ Object
this uploads the file to S3 through its parent class the final filename comes from the uploader once the file is successfully uploaded to S3.
Methods inherited from FormAttachment
Methods included from SentryLogging
#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger
Methods inherited from ApplicationRecord
descendants_using_encryption, lockbox_options, #timestamp_attributes_for_update_in_model, #valid?
Instance Method Details
#converted_filename ⇒ Object
19 20 21 |
# File 'app/models/supporting_evidence_attachment.rb', line 19 def converted_filename JSON.parse(file_data)['converted_filename'] end |
#set_file_data!(file, file_password = nil) ⇒ Object
this uploads the file to S3 through its parent class the final filename comes from the uploader once the file is successfully uploaded to S3
10 11 12 13 14 15 16 17 |
# File 'app/models/supporting_evidence_attachment.rb', line 10 def set_file_data!(file, file_password = nil) file_data_json = super au = if au.converted_exists? self.file_data = JSON.parse(file_data_json).merge('converted_filename' => au.final_filename).to_json end file_data end |