codeclimate Parameter value used in file name [brakeman] - send_file rails

265 views Asked by At

codeclimate error: Parameter value used in file name [brakeman]

 #  sample_file_path will be equal to "#{@export_path}_products_file-#{Time.zone.now}.xlsx"
   sample_file_path = ProductFile.new.call()
    send_file(
      sample_file_path,
      filename: 'sample_file.xlsx', type: 'application/text'
    )

According to sample_file() method of rails the first parameter has to be a direct 'string' no a parameter. It seems this does not have solution, just omit it. Unless they update that situation.

If you have a solution post it here.

0

There are 0 answers