Verified Commit a3f0ebf8 authored by Kaspar Vollenweider's avatar Kaspar Vollenweider 👻
Browse files

feat(semester-process-elegible-volunteer): add scope that gets volunteers wit...

feat(semester-process-elegible-volunteer): add scope that gets volunteers wit a assignment or group assignment that has started, ever
parent 7f09ef7d
......@@ -166,6 +166,12 @@ class Volunteer < ApplicationRecord
)
}
scope :have_mission, lambda {
left_joins(:assignments).left_joins(:group_assignments)
.where('assignments.id IS NOT NULL OR group_assignments.id IS NOT NULL')
.where('assignments.period_start IS NOT NULL OR group_assignments.period_start IS NOT NULL')
}
scope :will_take_more_assignments, (-> { where(take_more_assignments: true) })
scope :activeness_not_ended, lambda {
......
Supports Markdown
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