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

remove unused update_params_payment_source method #2227

Merged
merged 1 commit into from
Sep 29, 2017

Conversation

ccarruitero
Copy link
Contributor

This method was moved from Spree::Order::Checkout, and seems to be unused now that we use set_payment_parameters_amount method for the same.

@mamhoff
Copy link
Contributor

mamhoff commented Sep 19, 2017

I'm all for this. However, we don't just delete methods like that. Please deprecate it, and we can remove it in a future version. People might have used this method in their host apps, and just removing it without a warning would be a terrible dev experience.

@@ -782,11 +782,12 @@ def process_payments_before_complete
# }
#
def update_params_payment_source
if @updating_params[:order] && (@updating_params[:order][:payments_attributes] || @updating_params[:order][:existing_card])
if @updating_params&[:order] && (@updating_params&[:order]&[:payments_attributes] || @updating_params&[:order]&[:existing_card])

Choose a reason for hiding this comment

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

Surrounding space missing for operator &.

@@ -782,11 +782,12 @@ def process_payments_before_complete
# }
#
def update_params_payment_source
if @updating_params[:order] && (@updating_params[:order][:payments_attributes] || @updating_params[:order][:existing_card])
if @updating_params&[:order] && (@updating_params&[:order]&[:payments_attributes] || @updating_params&[:order]&[:existing_card])
Copy link
Contributor

Choose a reason for hiding this comment

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

Better figure out how to set some dummy data to this instance variable @updating_params in the test rather than changing the method. Given that it hasn't been tested so far, any change can break it really.

Copy link
Contributor

@cbrunsdon cbrunsdon left a comment

Choose a reason for hiding this comment

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

Fantastic, thanks a lot, always appreciate people removing code 👍

Copy link
Contributor

@jhawthorn jhawthorn left a comment

Choose a reason for hiding this comment

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

Thank you!

@jhawthorn jhawthorn merged commit aab557d into solidusio:master Sep 29, 2017
@ccarruitero ccarruitero deleted the cleanup branch October 16, 2017 04:08
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.

6 participants