Commit c4f590e2 authored by Jiri Strojil's avatar Jiri Strojil

Added logic to exclude missions that have run for a short time

parent 78b1108a
Pipeline #32964 passed with stage
in 43 minutes and 43 seconds
......@@ -71,8 +71,10 @@ class SemesterProcessVolunteer < ApplicationRecord
end
def build_missions(semester)
new_missions = volunteer.assignments.no_end.start_before(semester.end) +
volunteer.group_assignments.no_end.start_before(semester.end)
# if you change this then also change it within active_semester_mission(semester)
prob = semester.end.advance(weeks: -4)
new_missions = volunteer.assignments.no_end.start_before(prob) +
volunteer.group_assignments.no_end.start_before(prob)
semester_process_volunteer_missions << new_missions.map do |mission|
SemesterProcessVolunteerMission.new(mission: mission)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment