From bc8371632a346933a4559b4d453e46bf07f5befd Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire Date: Fri, 9 Sep 2022 10:12:28 +0100 Subject: [PATCH] feat: relocate redundant methods --- app/models/lettings_log.rb | 8 -------- app/services/csv/lettings_log_csv_service.rb | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/app/models/lettings_log.rb b/app/models/lettings_log.rb index aa854f420..142c48e52 100644 --- a/app/models/lettings_log.rb +++ b/app/models/lettings_log.rb @@ -465,14 +465,6 @@ class LettingsLog < ApplicationRecord location&.id end - def la_label - la - end - - def prevloc_label - prevloc - end - def self.to_csv(user = nil) Csv::LettingsLogCsvService.new(user).to_csv end diff --git a/app/services/csv/lettings_log_csv_service.rb b/app/services/csv/lettings_log_csv_service.rb index 35d8fb53e..6070e91c2 100644 --- a/app/services/csv/lettings_log_csv_service.rb +++ b/app/services/csv/lettings_log_csv_service.rb @@ -16,7 +16,7 @@ module Csv if %w[la prevloc].include? att label_from_value(record.send(att)) elsif %w[la_label prevloc_label].include? att - record.form.get_question(att.remove("_label"), record)&.label_from_value(record.send(att)) || label_from_value(record.send(att)) + record.form.get_question(att.remove("_label"), record)&.label_from_value(record.send(att.remove("_label"))) || label_from_value(record.send(att.remove("_label"))) else record.form.get_question(att, record)&.label_from_value(record.send(att)) || label_from_value(record.send(att)) end