Browse Source

don't use variables from the future

pull/2982/head
Carolyn 2 months ago
parent
commit
63fb3b06b3
  1. 2
      app/services/csv/lettings_log_csv_service.rb
  2. 2
      app/services/csv/sales_log_csv_service.rb

2
app/services/csv/lettings_log_csv_service.rb

@ -289,7 +289,7 @@ module Csv
exact_match = options.find { |definition| definition.year == @year } exact_match = options.find { |definition| definition.year == @year }
next exact_match if exact_match next exact_match if exact_match
options.max_by(&:year) options.select { |opt| opt.year < @year }.max_by(&:year)
end end
end end

2
app/services/csv/sales_log_csv_service.rb

@ -184,7 +184,7 @@ module Csv
exact_match = options.find { |definition| definition.year == @year } exact_match = options.find { |definition| definition.year == @year }
next exact_match if exact_match next exact_match if exact_match
options.max_by(&:year) options.select { |opt| opt.year < @year }.max_by(&:year)
end end
end end

Loading…
Cancel
Save