@ -185,7 +185,7 @@ private
when :deactivated
"#{@location.name} has been deactivated"
when :deactivating_soon
"#{@location.name} will deactivate on #{@location.deactivation_date.to_formatted_s(:govuk_date)}"
"#{@location.name} will deactivate on #{params[:location][:deactivation_date].to_formatted_s(:govuk_date)}"
end
@ -376,7 +376,7 @@ class Location < ApplicationRecord
def status
recent_deactivation = location_deactivations.deactivations_without_reactivation.first
return :active unless recent_deactivation.present?
return :active if recent_deactivation.blank?
return :deactivating_soon if Time.zone.now < recent_deactivation.deactivation_date
:deactivated
@ -1,3 +1,3 @@
class LocationDeactivation < ApplicationRecord
scope :deactivations_without_reactivation, ->() { where(reactivation_date: nil) }
scope :deactivations_without_reactivation, -> { where(reactivation_date: nil) }