Browse Source

Memoise empty address options result (#2675)

pull/2679/head v0.4.78
kosiakkatrina 3 months ago committed by GitHub
parent
commit
a74e3799f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      app/models/log.rb

5
app/models/log.rb

@ -130,7 +130,10 @@ class Log < ApplicationRecord
if [address_line1_input, postcode_full_input].all?(&:present?)
service = AddressClient.new(address_string)
service.call
return nil if service.result.blank? || service.error.present?
if service.result.blank? || service.error.present?
@address_options = []
return @answer_options
end
address_opts = []
service.result.first(10).each do |result|

Loading…
Cancel
Save