-
Notifications
You must be signed in to change notification settings - Fork 0
Nonprofit and cards references #1208
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
base: supporter_level_goal
Are you sure you want to change the base?
Conversation
| } | ||
| } | ||
|
|
||
| let(:nonprofit) { force_create(:nonprofit) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not think I needed to remove the creation of the nonprofit and creation of nonprofit admin in this spec file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand what you're asking.
wwahammy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please verify that nothing breaks when you run this code. It appears that it does if you login and go to settings for a nonprofit.
@wwahammy Tested this locally, and all pages render properly, there are no errors. |
| <hr> | ||
| <label>Payment Method</label> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is being labelled by the Payment Method label?
| elsif holder_type == :supporter | ||
| holder = Supporter.select("id, email, nonprofit_id").includes(:cards, :nonprofit).find(card_data[:holder_id]) | ||
| end | ||
| holder_type == :supporter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What affect does this line have on the behavior of the code?
| # @type [Nonprofit] holder | ||
| card = holder.create_active_card(card_data) | ||
| elsif holder_type == :supporter | ||
| holder_type == :supporter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What affect does this line have on the behavior of the code?
| scope :amex_only, -> { where("cards.name ILIKE ? OR cards.name ILIKE ?", "American Express%", "amex%") } | ||
| scope :not_amex, -> { where("cards.name NOT ILIKE ? AND cards.name NOT ILIKE ?", "American Express%", "amex%") } | ||
|
|
||
| scope :held_by_nonprofits, -> { where("cards.holder_type = ? ", "Nonprofit") } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should keep this, just because we removed the references in the code doesn't mean we've removed all of the records for nonprofit cards. At some point, we'll need to clear those out and delete them.
Please note that we need to do that.
| # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later | ||
| require "rails_helper" | ||
| describe "nonprofits factory" do | ||
| describe :with_billing_subscription_on_stripe do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why keep an empty spec? It's a headache to keep a spec file with nothing in it.
| def failed_notice(np_id) | ||
| @nonprofit = Nonprofit.find(np_id) | ||
| @billing_subscription = @nonprofit.billing_subscription | ||
| @card = @nonprofit.active_card |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you've deleted this line but what is this mailer used for? What about the view associated with the mailer action, does this change break it? Or do we even need the mailer or view?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are traits in this file which reference active_card. If we're removing the active_card attribute and other associated methods, those need to be addressed too.
| } | ||
| } | ||
|
|
||
| let(:nonprofit) { force_create(:nonprofit) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand what you're asking.
NOTE: DO NOT discuss internal CommitChange information in your PR; this PR will be public.
Link back to the issue in the Tix repo when you need to do that.
Fixes Delete the reference between Nonprofit and Card