Skip to content
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

Merged
merged 4 commits into from
Mar 28, 2017

Conversation

mehalshah
Copy link
Contributor

No description provided.

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'
]
Copy link
Contributor

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]
)
Copy link
Contributor

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.

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'
Copy link
Contributor

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

@mehalshah mehalshah merged commit 4382295 into staging Mar 28, 2017
@mehalshah mehalshah deleted the auto_enrollment_in_plc_after_pd_enrollment branch March 29, 2017 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants