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

Refactor affiliate linking. #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alanpeabody
Copy link
Contributor

By using a struct to define the state of our original to affiliated
transformation we reveal more about our intentions.

By using a struct to define the state of our original to affiliated
transformation we reveal more about our intentions.
@@ -0,0 +1,9 @@
defmodule ElloClick.Affiliate.Link do
defstruct [original: nil, affiliated: nil, is_affiliated: false]
Copy link

@jayzes jayzes Aug 10, 2016

Choose a reason for hiding this comment

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

Is it worth expanding out the names of these fields a bit as long as we're trying to be extra-clear (e.g. original_link, affiliated_link)? Not sure if it's idiomatic, just a thought.

Copy link

Choose a reason for hiding this comment

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

I don't mind the shorter names. Since they are in a Link struct the "link" prefix is not needed. Not sure what you think @alanpeabody.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tend towards brevity in variable names, but happy to update to add them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We were actually thinking this could even be taken a little further and have those be %URI{} structs so we could match on hostname without schema easier.

Copy link

Choose a reason for hiding this comment

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

Ah nice, that'd be cool.

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.

3 participants