Class: DecisionReviewEvidenceAttachmentUploader
- Inherits:
-
CarrierWave::Uploader::Base
- Object
- CarrierWave::Uploader::Base
- DecisionReviewEvidenceAttachmentUploader
- Includes:
- SetAWSConfig
- Defined in:
- app/uploaders/decision_review_evidence_attachment_uploader.rb
Overview
Files uploaded as part of a Notice of Disagreement submission that will be sent to Lighthouse upon form submission.
Instance Method Summary collapse
- #extension_allowlist ⇒ Object
-
#initialize(decision_review_guid) ⇒ DecisionReviewEvidenceAttachmentUploader
constructor
A new instance of DecisionReviewEvidenceAttachmentUploader.
- #set_storage_options! ⇒ Object
- #size_range ⇒ Object
- #store_dir ⇒ Object
Methods included from SetAWSConfig
Constructor Details
#initialize(decision_review_guid) ⇒ DecisionReviewEvidenceAttachmentUploader
Returns a new instance of DecisionReviewEvidenceAttachmentUploader.
15 16 17 18 19 20 |
# File 'app/uploaders/decision_review_evidence_attachment_uploader.rb', line 15 def initialize(decision_review_guid) super @decision_review_guid = decision_review_guid end |
Instance Method Details
#extension_allowlist ⇒ Object
11 12 13 |
# File 'app/uploaders/decision_review_evidence_attachment_uploader.rb', line 11 def extension_allowlist %w[pdf] end |
#set_storage_options! ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'app/uploaders/decision_review_evidence_attachment_uploader.rb', line 28 def s3_settings = Settings.decision_review.s3 # defaults to CarrierWave::Storage::File if not AWS unless a real aws_access_key_id is set if s3_settings.aws_access_key_id.present? set_aws_config( s3_settings.aws_access_key_id, s3_settings.aws_secret_access_key, s3_settings.region, s3_settings.bucket ) end end |
#size_range ⇒ Object
7 8 9 |
# File 'app/uploaders/decision_review_evidence_attachment_uploader.rb', line 7 def size_range 1.byte...100_000_000.bytes end |
#store_dir ⇒ Object
22 23 24 25 26 |
# File 'app/uploaders/decision_review_evidence_attachment_uploader.rb', line 22 def store_dir raise 'missing guid' if @decision_review_guid.blank? "decision_review/#{@decision_review_guid}" end |