Add stripe external account model and tests#576
Merged
Conversation
joshsmith
commented
Dec 14, 2016
Contributor
Author
joshsmith
left a comment
There was a problem hiding this comment.
@paulsullivanjr we could use some minor changes here.
Thanks for doing this!
| def changeset(struct, params \\ %{}) do | ||
| struct | ||
| |> cast(params, [:id_from_stripe, :account_id_from_stripe, :account_holder_name, :account_holder_type, :bank_name, :country, :currency, :default_for_currency, :fingerprint, :last4, :routing_number, :status]) | ||
| |> validate_required([:id_from_stripe, :account_id_from_stripe, :account_holder_name, :account_holder_type, :bank_name, :country, :currency, :default_for_currency, :fingerprint, :last4, :routing_number, :status]) |
Contributor
Author
There was a problem hiding this comment.
Should probably split these out into an @.
Also don't know if we should mark all as required. I think only ones required would be id_from_stripe and account_id_from_stripe.
| alias CodeCorps.StripeExternalAccount | ||
|
|
||
| @valid_attrs %{account_holder_name: "some content", account_holder_type: "some content", account_id_from_stripe: "some content", bank_name: "some content", country: "some content", currency: "some content", default_for_currency: "some content", fingerprint: "some content", id_from_stripe: "some content", last4: "some content", routing_number: "some content", status: "some content"} | ||
| @invalid_attrs %{} |
Contributor
Author
There was a problem hiding this comment.
Per the comment below, can probably use less attrs here for it to be valid.
e0ceca5 to
7898517
Compare
Contributor
Author
|
🙌 nice work @paulsullivanjr |
Contributor
|
thanks. I can make the changes you suggested. Should be able to do it tonight. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's in this PR?
@paulsullivanjr's work adding an external account model, migration and test.
References
Fixes #571