Browse Source

Merge 1e1b5b7899 into 93a00f976d

pull/3126/merge
Samuel Young 2 weeks ago committed by GitHub
parent
commit
1e428a3e80
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      app/models/form/lettings/questions/location_id_search.rb

4
app/models/form/lettings/questions/location_id_search.rb

@ -16,7 +16,7 @@ class Form::Lettings::Questions::LocationIdSearch < ::Form::Question
end
def answer_options
answer_opts = {}
answer_opts = { "" => "Select an option" }
return answer_opts unless ActiveRecord::Base.connected?
Location.visible.started_in_2_weeks.select(:id, :postcode, :name).each_with_object(answer_opts) do |location, hsh|
@ -29,7 +29,7 @@ class Form::Lettings::Questions::LocationIdSearch < ::Form::Question
return {} unless lettings_log.scheme
scheme_location_ids = lettings_log.scheme.locations.visible.confirmed.pluck(:id)
answer_options.select { |k, _v| scheme_location_ids.include?(k.to_i) }.to_h
answer_options.select { |k, _v| scheme_location_ids.include?(k.to_i) or k == "" }.to_h
end
def hidden_in_check_answers?(lettings_log, _current_user = nil)

Loading…
Cancel
Save