Class: Form1010cg::PoaUploader

Inherits:
CarrierWave::Uploader::Base
  • Object
show all
Includes:
LogMetrics, SetAWSConfig, UploaderVirusScan
Defined in:
app/uploaders/form1010cg/poa_uploader.rb

Constant Summary

Constants included from LogMetrics

LogMetrics::KEY_PREFIX

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from UploaderVirusScan

#validate_virus_free

Methods included from LogMetrics

#log_metrics

Methods included from SetAWSConfig

#set_aws_config

Constructor Details

#initialize(form_attachment_guid) ⇒ PoaUploader

Returns a new instance of PoaUploader.



13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/uploaders/form1010cg/poa_uploader.rb', line 13

def initialize(form_attachment_guid)
  super

  set_aws_config(
    Settings.form_10_10cg.poa.s3.aws_access_key_id,
    Settings.form_10_10cg.poa.s3.aws_secret_access_key,
    Settings.form_10_10cg.poa.s3.region,
    Settings.form_10_10cg.poa.s3.bucket
  )

  @store_dir = form_attachment_guid
end

Instance Attribute Details

#store_dirObject (readonly)

Returns the value of attribute store_dir.



11
12
13
# File 'app/uploaders/form1010cg/poa_uploader.rb', line 11

def store_dir
  @store_dir
end

Instance Method Details

#content_type_allowlistObject



30
31
32
# File 'app/uploaders/form1010cg/poa_uploader.rb', line 30

def content_type_allowlist
  %w[image/jpg image/jpeg image/png application/pdf]
end

#extension_allowlistObject



26
27
28
# File 'app/uploaders/form1010cg/poa_uploader.rb', line 26

def extension_allowlist
  %w[jpg jpeg png pdf]
end

#size_rangeObject



34
35
36
# File 'app/uploaders/form1010cg/poa_uploader.rb', line 34

def size_range
  1.byte...10.megabytes
end