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

Removes ja_resource dependency from OrganizationInviteController #1051

Conversation

lkoller
Copy link
Contributor

@lkoller lkoller commented Oct 10, 2017

What's in this PR?

This PR removes the ja_resource from the OrganizationInviteController

References

Fixes #894

Progress on: #864

@joshsmith joshsmith force-pushed the 894-remove-ja-resource-from-organization-invite-controller branch from 9488d23 to 8f389c0 Compare October 10, 2017 23:57
@joshsmith joshsmith force-pushed the 894-remove-ja-resource-from-organization-invite-controller branch from 8f389c0 to ced89bc Compare October 11, 2017 00:08
Copy link
Contributor

@joshsmith joshsmith left a comment

Choose a reason for hiding this comment

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

Great work here! I hope you don't mind that I fixed the merge conflict, in large part because I was the reviewer for the files that caused the conflict.

I pointed out some other things here that I fixed along the way for future reference, so you can still get the benefit of a (hopefully helpful) code review without the explicit need to change it yourself.


@spec model :: module
def model, do: CodeCorps.OrganizationInvite
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be removed.


import CodeCorps.Helpers.Query, only: [id_filter: 2]
Copy link
Contributor

Choose a reason for hiding this comment

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

This was no longer in use since you're using Helpers.Query.id_filter/1 directly in the show/2.

{:ok, :authorized} <- current_user |> Policy.authorize(:create, %OrganizationInvite{}, params),
{:ok, %OrganizationInvite{} = organization_invite} <- %OrganizationInvite{} |> OrganizationInvite.create_changeset(params) |> Repo.insert do

send_email(organization_invite)
Copy link
Contributor

Choose a reason for hiding this comment

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

There was a merge conflict due to a recent merge. The rebase made the changeset really weird so I had to come in and do this manually. You'll see below that render_create/2 was removed, but I kept the private send_email/1 and opted not to handle it within the with but inside the result, where I think the async process makes more sense.

@joshsmith
Copy link
Contributor

@lkoller 🙌 on this.

I invited you as a member – you should be able to view the invitation here – so you can merge at will!

Please do stop by our Slack and say hi: http://slack.codecorps.org/

@joshsmith
Copy link
Contributor

Just a heads up that I've since merged something else in, so you'll need to do a git rebase on your upstream/develop after syncing it in your fork.

@begedin begedin merged commit 2576c65 into code-corps:develop Oct 11, 2017
@begedin
Copy link
Contributor

begedin commented Oct 11, 2017

Great work @lkoller

I went ahead and merged this for you, so I can have an easier time merging other branches.

@lkoller
Copy link
Contributor Author

lkoller commented Oct 15, 2017

Thank you so much for the great feedback! Excited to work on a few more of these too

@lkoller lkoller deleted the 894-remove-ja-resource-from-organization-invite-controller branch October 15, 2017 16:42
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