Class: Form1010cg::Attachment

Inherits:
FormAttachment show all
Defined in:
app/models/form1010cg/attachment.rb

Constant Summary collapse

ATTACHMENT_UPLOADER_CLASS =
::Form1010cg::PoaUploader

Instance Method Summary collapse

Methods inherited from FormAttachment

#get_file, #parsed_file_data, #set_file_data!

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

#to_local_fileObject



7
8
9
10
11
12
13
14
# File 'app/models/form1010cg/attachment.rb', line 7

def to_local_file
  remote_file = get_file
  local_path  = "tmp/#{remote_file.path.gsub('/', '_')}"

  File.write(local_path, remote_file.read)

  local_path
end