From e5cc2afb27b778593c6e850e2690a1b8ca6a3255 Mon Sep 17 00:00:00 2001 From: Kat Date: Thu, 17 Nov 2022 08:31:14 +0000 Subject: [PATCH] fixes --- app/controllers/locations_controller.rb | 4 ++-- app/models/form/lettings/questions/location_id.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/locations_controller.rb b/app/controllers/locations_controller.rb index da0c58d3f..8ee8b9663 100644 --- a/app/controllers/locations_controller.rb +++ b/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 diff --git a/app/models/form/lettings/questions/location_id.rb b/app/models/form/lettings/questions/location_id.rb index cae6463a9..84b37ec50 100644 --- a/app/models/form/lettings/questions/location_id.rb +++ b/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)