Browse Source

only group variables by name, not by description

pull/2982/head
Carolyn 2 months ago
parent
commit
8b69d013e5
  1. 3
      app/services/csv/lettings_log_csv_service.rb
  2. 3
      app/services/csv/sales_log_csv_service.rb

3
app/services/csv/lettings_log_csv_service.rb

@ -284,8 +284,7 @@ module Csv
end
def lettings_log_definitions
CsvVariableDefinition.lettings.group_by { |record| [record.variable, record.definition] }
.map { |_, options|
CsvVariableDefinition.lettings.group_by(&:variable).map { |_, options|
exact_match = options.find { |definition| definition.year == @year }
next exact_match if exact_match

3
app/services/csv/sales_log_csv_service.rb

@ -179,8 +179,7 @@ module Csv
end
def sales_log_definitions
CsvVariableDefinition.sales.group_by { |record| [record.variable, record.definition] }
.map { |_, options|
CsvVariableDefinition.sales.group_by(&:variable).map { |_, options|
exact_match = options.find { |definition| definition.year == @year }
next exact_match if exact_match

Loading…
Cancel
Save