Browse Source

feat: relocate redundant methods

pull/847/head
natdeanlewissoftwire 2 years ago
parent
commit
bc8371632a
  1. 8
      app/models/lettings_log.rb
  2. 2
      app/services/csv/lettings_log_csv_service.rb

8
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

2
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

Loading…
Cancel
Save