diff --git a/app/models/location.rb b/app/models/location.rb index 02fad559c..4fd050789 100644 --- a/app/models/location.rb +++ b/app/models/location.rb @@ -221,7 +221,7 @@ class Location < ApplicationRecord end def soonest_reactivation(date) - location_deactivation_periods.deactivations_with_reactivation.where(date < reactivation_date).order(reactivation_date).first + location_deactivation_periods.deactivations_with_reactivation.where("reactivation_date > ?", date).order(reactivation_date: :asc).first end def status