Created
February 20, 2020 15:06
-
-
Save qizwiz/590d9bc3540b8bcb27b5cd5acf1ce81e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def email_task_link(task) | |
product = task.product | |
practice = task.patient.practice | |
patient = task.patient | |
types = %w(sm_dso_doctor_setup_review_approve_order_aligner assign_clinical_advisor select_package_type) | |
options = [ | |
{ link: 'task_setup_review_url', args: %i(practice task) }, | |
{ link: 'edit_practice_patient_url', args: %i(practice task) }, | |
{ link: 'new_order_url', args: %i(practice patient) } | |
] | |
kinds = [types, options].transpose.to_h | |
byebug | |
case task.kind | |
when types | |
send kinds[task.kind][:link].to_sym, *kinds[task.kind][:args] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment