-
-
Notifications
You must be signed in to change notification settings - Fork 725
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
[Spree 2 Upgrade] WIP - Added adapted order.ship_method= #2669
[Spree 2 Upgrade] WIP - Added adapted order.ship_method= #2669
Conversation
if shipments.empty? | ||
shipment = Spree::Shipment.new | ||
shipment.order = self | ||
shipment.save |
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.
AFAIK we don't need this save as AR persists the order and all its associations when doing a order.save
. Correct me if I'm wrong.
shipments << shipment | ||
end | ||
shipments.first.add_shipping_method(shipping_method, true) | ||
end |
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.
Have we investigated how this works with the way Spree creates shipments in https://github.com/openfoodfoundation/spree/blob/fe0a1311abb097bf3ac8001a24246c6cff5ecdbb/core/app/models/spree/order.rb#L506-L515 ? That's the only place I know in Spree's codebase where shipments are created.
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.
yes, I have seen that code. I am closing this PR actually, we need to fix the specs and then we will see if this is still required.
I am closing this PR for now, I dont think we will need this adapter. We will have to replace all places where shipping_method= is used. Mostly specs as listed in #2662 |
What? Why?
Closes #2662
What should we test?
Spree upgrade issues cannot be tested yet.
How is this related to the Spree upgrade?
Part of order multi-shipments epic.
Dependencies
Related to #2654