Browse Source

fix: check for startdate presence

pull/1023/head
natdeanlewissoftwire 4 years ago
parent
commit
978cb3c9e7
  1. 2
      app/models/location.rb

2
app/models/location.rb

@ -380,7 +380,7 @@ class Location < ApplicationRecord
return :deactivated if open_deactivation&.deactivation_date.present? && Time.zone.now >= open_deactivation.deactivation_date return :deactivated if open_deactivation&.deactivation_date.present? && Time.zone.now >= open_deactivation.deactivation_date
return :deactivating_soon if open_deactivation&.deactivation_date.present? && Time.zone.now < open_deactivation.deactivation_date return :deactivating_soon if open_deactivation&.deactivation_date.present? && Time.zone.now < open_deactivation.deactivation_date
return :reactivating_soon if recent_deactivation&.reactivation_date.present? && Time.zone.now < recent_deactivation.reactivation_date return :reactivating_soon if recent_deactivation&.reactivation_date.present? && Time.zone.now < recent_deactivation.reactivation_date
return :activating_soon if Time.zone.now < startdate return :activating_soon if startdate.present? && Time.zone.now < startdate
:active :active
end end

Loading…
Cancel
Save