-
Notifications
You must be signed in to change notification settings - Fork 479
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
PD Enrollment now automatically generates enrollment in plc #14041
PD Enrollment now automatically generates enrollment in plc #14041
Conversation
Pd::Workshop::COURSE_ECS, 'ECS Support', | ||
Pd::Workshop::COURSE_CS_IN_A, 'CS in Algebra Support', | ||
Pd::Workshop::COURSE_CS_IN_S, 'CS in Science Support' | ||
] |
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.
This mapping seems more related to workshop than enrollment, and should go with the other workshop constants in workshop.rb
. It can be exposed via something like workshop.associated_online_course
Also why Hash[...]
instead of {...}
? And please .freeze
the hash. See SECTION_TYPE_MAP for an example.
def enroll_in_corresponding_online_learning | ||
plc_course = Plc::Course.find_by( | ||
name: WORKSHOP_COURSE_ONLINE_LEARNING_MAPPING[workshop.course] | ||
) |
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.
Like above, I think this find logic better belongs in the Workshop model. Encapsulate this in a method, something like workshop.associated_online_course
that returns the matching PLC course or nil.
dashboard/app/models/pd/workshop.rb
Outdated
Pd::Workshop::COURSE_CSP => 'CSP Support', | ||
Pd::Workshop::COURSE_ECS => 'ECS Support', | ||
Pd::Workshop::COURSE_CS_IN_A => 'CS in Algebra Support', | ||
Pd::Workshop::COURSE_CS_IN_S => 'CS in Science Support' |
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.
note now that this is in Pd::Workshop
you don't need the prefix here
No description provided.