From 3d4325f1a8637a258721612129b33a845d9408fa Mon Sep 17 00:00:00 2001 From: Minhazur Rahaman Date: Fri, 29 Mar 2024 13:53:53 -0400 Subject: [PATCH] APPEALS-42711 changed names of classes and methods to fix code climate issue --- app/controllers/hearings/transcription_files_controller.rb | 2 +- app/jobs/hearings/fetch_webex_recordings_list_job.rb | 4 ++-- app/models/hearings/transcription_file.rb | 2 +- spec/models/hearings/transcription_file_spec.rb | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/hearings/transcription_files_controller.rb b/app/controllers/hearings/transcription_files_controller.rb index a3c4f389529..aecdf590b02 100644 --- a/app/controllers/hearings/transcription_files_controller.rb +++ b/app/controllers/hearings/transcription_files_controller.rb @@ -8,7 +8,7 @@ class Hearings::TranscriptionFilesController < ApplicationController # Downloads file and sends to user's local computer def download_transcription_file - tmp_location = file.fetch_from_s3 + tmp_location = file.download_file_from_s3 File.open(tmp_location, "r") { |stream| send_data stream.read, filename: file.file_name } file.clean_up_tmp_location end diff --git a/app/jobs/hearings/fetch_webex_recordings_list_job.rb b/app/jobs/hearings/fetch_webex_recordings_list_job.rb index c24c292fb37..a67a40074fb 100644 --- a/app/jobs/hearings/fetch_webex_recordings_list_job.rb +++ b/app/jobs/hearings/fetch_webex_recordings_list_job.rb @@ -33,8 +33,8 @@ def perform response = fetch_recordings_list topics = response.topics topic_num = 0 - response.ids.each do |n| - Hearings::FetchWebexRecordingsDetailsJob.perform_later(id: n, topic: topics[topic_num]) + response.ids.each do |id| + Hearings::FetchWebexRecordingsDetailsJob.perform_later(id: id, topic: topics[topic_num]) topic_num += 1 end end diff --git a/app/models/hearings/transcription_file.rb b/app/models/hearings/transcription_file.rb index eb7aedb33fa..efb2c747ffd 100644 --- a/app/models/hearings/transcription_file.rb +++ b/app/models/hearings/transcription_file.rb @@ -12,7 +12,7 @@ class TranscriptionFile < CaseflowRecord # Purpose: Fetches file from S3 # Return: The temporary save location of the file - def fetch_from_s3 + def download_file_from_s3 S3Service.fetch_file(aws_link, tmp_location) tmp_location end diff --git a/spec/models/hearings/transcription_file_spec.rb b/spec/models/hearings/transcription_file_spec.rb index 18526ece900..14e8602b05f 100644 --- a/spec/models/hearings/transcription_file_spec.rb +++ b/spec/models/hearings/transcription_file_spec.rb @@ -12,7 +12,7 @@ describe "model functions" do it "downloading a file" do - expect(uploaded_file.fetch_from_s3).to eq("#{Rails.root}/tmp/transcription_files/vtt/transcript.vtt") + expect(uploaded_file.download_file_from_s3).to eq("#{Rails.root}/tmp/transcription_files/vtt/transcript.vtt") end it "uploading a file" do