Commit 387723f4 authored by Jiri Strojil's avatar Jiri Strojil

Merge branch 'fixes/ended-mission-renders' into 'develop'

Active missions only

See merge request !897
parents a8bbf092 a02478db
Pipeline #32940 passed with stage
in 35 minutes and 22 seconds
......@@ -35,8 +35,18 @@ class SemesterProcessVolunteer < ApplicationRecord
joins(:semester_process).where(semester_process: semester).joins(:semester_process_mails).where("semester_process_mails.kind = 0")
scope :active_missions, lambda {
joins(:semester_process_volunteer_missions).includes(semester_process_volunteer_missions: [:assignment, :group_assignment])
.where("semester_process_volunteer_missions.assignment_id IS NOT NULL AND
(assignments.period_end IS NULL OR assignments.period_end >= lower(semester_processes.semester))
semester_process_volunteer_missions.group_assignment_id IS NOT NULL AND
(group_assignments.period_end is NULL OR group_assignments.period_end >= lower(semester_processes.semester))")
.references(:assignments, :group_assignments)
scope :index, lambda { |semester = nil|
scope :without_feedback, lambda {
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