Browse Source

lint

pull/996/head
Kat 4 years ago
parent
commit
ea62284f78
  1. 2
      app/controllers/locations_controller.rb
  2. 2
      app/models/location.rb
  3. 2
      app/models/location_deactivation.rb

2
app/controllers/locations_controller.rb

@ -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
end

2
app/models/location.rb

@ -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

2
app/models/location_deactivation.rb

@ -1,3 +1,3 @@
class LocationDeactivation < ApplicationRecord
scope :deactivations_without_reactivation, ->() { where(reactivation_date: nil) }
scope :deactivations_without_reactivation, -> { where(reactivation_date: nil) }
end

Loading…
Cancel
Save