app/controllers/v0/caregivers_assistance_claims_controller.rb
def download_pdf
      # Brakeman will raise a warning if we use a claim's method or attribute in the source file name.
      # Use an arbitrary uuid for the source file name and don't use the return value of claim#to_pdf
      # as the source_file_path (to prevent changes in the the filename creating a vunerability in the future).
      source_file_path = PdfFill::Filler.fill_form(@claim, SecureRandom.uuid, sign: false)
      client_file_name = file_name_for_pdf(@claim.veteran_data)
      file_contents    = File.read(source_file_path)

      File.delete(source_file_path)

      auditor.record(:pdf_download)

      send_data file_contents, filename: client_file_name, type: 'application/pdf', disposition: 'attachment'
    end
# If we were unable to submit the user's claim digitally, we allow them to the download
# the 10-10CG PDF, pre-filled with their data, for them to mail in.
If we were unable to submit the user's claim digitally, we allow them to the download
the 10-10CG PDF, pre-filled with their data, for them to mail in.
If we were unable to submit the user ' s claim digitally we allow them to the download the 10 - 10CG PDF pre - filled with their data for them to mail in .
def download_pdf
      source_file_path = PdfFill::Filler.fill_form(@claim, SecureRandom.uuid, sign: false)
      client_file_name = file_name_for_pdf(@claim.veteran_data)
      file_contents    = File.read(source_file_path)
      File.delete(source_file_path)
      auditor.record(:pdf_download)
      send_data file_contents, filename: client_file_name, type: 'application/pdf', disposition: 'attachment'
    end
def download_pdf source_file_path = PdfFill :: Filler . fill_form ( @claim , SecureRandom . uuid , sign : false ) client_file_name = file_name_for_pdf ( @claim . veteran_data ) file_contents = File . read ( source_file_path ) File . delete ( source_file_path ) auditor . record ( :pdf_download ) send_data file_contents , filename : client_file_name , type : 'application/pdf' , disposition : 'attachment' end
If we were unable to submit the user's claim digitally, we allow them to the download
the 10-10CG PDF, pre-filled with their data, for them to mail in.
If we were unable to submit the user ' s claim digitally we allow them to the download the 10 - 10CG PDF pre - filled with their data for them to mail in .
# Brakeman will raise a warning if we use a claim's method or attribute in the source file name. # Use an arbitrary uuid for the source file name and don't use the return value of claim#to_pdf # as the source_file_path (to prevent changes in the the filename creating a vunerability in the future).