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

Use CDO module for link helper #33064

Merged
merged 1 commit into from
Feb 11, 2020

Conversation

bencodeorg
Copy link
Contributor

Fixes a link that caused this Honeybadger error (albeit from staging) -- we think the link worked locally because we load both pegasus and dashboard into a single Ruby instance, whereas we do not do this in other environments. As a result, I was originally using this global pegasus method , instead of the one in the CDO module.

Also improves a hard coded link to use the same approach per suggestion from @breville.

Testing story

Tested manually on my machine.

Reviewer Checklist:

  • Tests provide adequate coverage
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@bencodeorg bencodeorg requested a review from a team February 10, 2020 22:40
@bencodeorg bencodeorg changed the title Use CDO prefix to link helper Use CDO module for link helper Feb 10, 2020
@@ -1,6 +1,6 @@
%p
The following person has requested to connect with their local Code.org Regional Partner
= link_to('through this form,', 'https://code.org/educate/professional-learning/contact-regional-partner')
= link_to('through this form,', CDO.code_org_url('educate/professional-learning/contact-regional-partner', CDO.default_scheme))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The scheme should be optional; is it needed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH I followed precedent from the other mailer -- I looked up what this default_scheme variable contains (http vs https), but couldn't find anything in Rails docs about how it is used in a link_to

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, because I misinterpreted this as an argument to link_to, which it is not 🤦‍♂ No wonder I couldn't find any docs!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, sounds like a protocol relative URL is now out of fashion though it's quite useful for our own development environments.

But it sounds like there are particular pitfalls when they're used in emails, so that's probably a good reason to specify the protocol explicitly here.

@bencodeorg bencodeorg merged commit dce938c into staging Feb 11, 2020
@bencodeorg bencodeorg deleted the regional-partner-contact-link-updates branch February 11, 2020 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants