Browse Source

Fix some tests

pull/2605/head
Manny Dinssa 2 years ago
parent
commit
96b3d3c25a
  1. 2
      app/helpers/locations_helper.rb

2
app/helpers/locations_helper.rb

@ -107,11 +107,11 @@ private
periods << ActivePeriod.new(deactivation.reactivation_date, nil)
end
if location.scheme.scheme_deactivation_periods.any?
last_location_deactivation_date = sorted_deactivation_periods.last&.deactivation_date
scheme_periods = location.scheme.scheme_deactivation_periods
.where("deactivation_date > ? AND (reactivation_date < ? OR reactivation_date IS NULL)", location.available_from, last_location_deactivation_date || Time.zone.now)
.sort_by(&:deactivation_date)
if scheme_periods.any?
scheme_periods.each do |scheme_period|
periods.last.to = scheme_period.deactivation_date
periods << ActivePeriod.new(scheme_period.reactivation_date, nil)

Loading…
Cancel
Save