Browse Source

fixes

pull/996/head
Kat 4 years ago
parent
commit
e5cc2afb27
  1. 4
      app/controllers/locations_controller.rb
  2. 2
      app/models/form/lettings/questions/location_id.rb

4
app/controllers/locations_controller.rb

@ -185,12 +185,12 @@ private
when :deactivated
"#{@location.name} has been deactivated"
when :deactivating_soon
"#{@location.name} will deactivate on #{params[:location][:deactivation_date].to_formatted_s(:govuk_date)}"
"#{@location.name} will deactivate on #{deactivation_date.to_time.to_formatted_s(:govuk_date)}"
end
end
def update_affected_logs
@location.lettings_logs.filter_by_before_startdate(params[:location][:deactivation_date]).update!(location: nil, scheme: nil)
@location.lettings_logs.filter_by_before_startdate(deactivation_date.to_time).update!(location: nil, scheme: nil)
end
def deactivation_date

2
app/models/form/lettings/questions/location_id.rb

@ -23,7 +23,7 @@ class Form::Lettings::Questions::LocationId < ::Form::Question
end
end
def displayed_answer_options(lettings_log)
def displayed_answer_options(lettings_log, _user = nil)
return {} unless lettings_log.scheme
scheme_location_ids = lettings_log.scheme.locations.pluck(:id)

Loading…
Cancel
Save