-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CST-1207: rectify mentor pools when a participant is rectified #2913
CST-1207: rectify mentor pools when a participant is rectified #2913
Conversation
19bbd7e
to
d471f8c
Compare
Created review app at https://ecf-review-pr-2913.london.cloudapps.digital |
Smoke tests passed against the review app. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just one comment about the by
scope.
app/models/school_mentor.rb
Outdated
@@ -5,5 +5,6 @@ class SchoolMentor < ApplicationRecord | |||
belongs_to :participant_profile, class_name: "ParticipantProfile::Mentor" | |||
belongs_to :preferred_identity, class_name: "ParticipantIdentity" | |||
|
|||
scope :by, ->(participant_profile) { where(participant_profile:) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure of the value of this as it is only a simple where(participant_profile:)
and is a bit ambiguous, what if I want want to look up by
school? I get it's adding a bit of sugar but it then also becomes something else to remember.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, code rewritten without the scope.
d471f8c
to
ead966b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Context
When a school gets closed their participants are moved to its successor but the mentor pools are left unchanged.
Changes proposed in this pull request
Rectify the mentor pools of the school and its successor so the entries are moved from one to the other.
Guidance to review