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

feat(semester-process-elegible-volunteer): add method...

feat(semester-process-elegible-volunteer): add method semester_process_eligible that joins and groups the relevant scopes for semester process volunteers
parent d32fffc3
Pipeline #28616 passed with stage
in 35 minutes and 26 seconds
......@@ -96,6 +96,7 @@ class Volunteer < ApplicationRecord
return joins(:user).merge(User.with_pending_invitation) if process == 'havent_logged_in'
where(acceptance: process)
}
scope :with_hours, (-> { joins(:hours) })
scope :with_assignments, (-> { joins(:assignments) })
scope :with_group_assignments, (-> { joins(:group_assignments) })
......@@ -183,6 +184,14 @@ class Volunteer < ApplicationRecord
)
}
def self.semester_process_eligible(semester)
joins(:contact).no_semester_process(semester)
.active_semester_mission(semester)
.group('volunteers.id')
end
## Activness Scopes
#
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