-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conversation
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. |
382761e
to
e2afdbb
Compare
core/app/models/spree/order.rb
Outdated
@@ -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]) |
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.
Surrounding space missing for operator &.
core/app/models/spree/order.rb
Outdated
@@ -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]) |
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.
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.
e2afdbb
to
5389c70
Compare
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.
Fantastic, thanks a lot, always appreciate people removing code 👍
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.
Thank you!
This method was moved from
Spree::Order::Checkout
, and seems to be unused now that we useset_payment_parameters_amount
method for the same.