Add inverse_of to order.payments#1406
Merged
jordan-brough merged 2 commits intosolidusio:masterfrom Aug 29, 2016
Merged
Conversation
This doesn't seem to happen automatically and is more important now
that we're using cached association objects in OrderUpdater (see
Solidus PR 1389). Solidus 1.4 broke some of our specs without it.
In a Solidus sandbox without this patch:
>> o = Spree::Order.create!
>> p = o.payments.create!
>> puts p.order.object_id, o.object_id
70240633410460
70240634674300
With this patch:
>> o = Spree::Order.create!
>> p = o.payments.create!
>> puts p.order.object_id, o.object_id
70145793491740
70145793491740
There is some important history around this particular `inverse_of` --
see solidusio/solidus PR 407 and spree/spree_gateway PR 132.
Commit d7b8c73 in Solidus removed part of the specs around this,
assuming that the `inverse_of` was automatically added, but it doesn't
actually seem to be (see above). The remaining tests around the issue
still pass.
Contributor
|
👍 it's time to do this. We probably can also drop the |
Contributor
|
I'm good on this too, thanks jordan 👍 |
See code comments in spec.
Contributor
Author
|
I've gone ahead and removed the reload mentioned by @jhawthorn and added some more comments on the specs for that. Assuming specs go green I'll merge this. Shall we backport this to 1.4 as well? |
bbuchalter
pushed a commit
to TommyJohnWear/solidus
that referenced
this pull request
Nov 15, 2016
…t-inverse-of Add `inverse_of` to order.payments
gmacdougall
added a commit
to TommyJohnWear/solidus
that referenced
this pull request
Nov 16, 2016
Merge pull request solidusio#1406 from jordan-brough/add-order-payment-inverse-of
Contributor
|
For those who are investigating this issue be sure to also look at what impact this PR had by reviewing #1416 |
bbuchalter
pushed a commit
to TommyJohnWear/solidus
that referenced
this pull request
May 26, 2017
…t-inverse-of Add `inverse_of` to order.payments
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.
This doesn't seem to happen automatically and is more important now
that we're using cached association objects in OrderUpdater (see
#1389). Solidus 1.4 broke some functionality in our app without it. This
after_savein Payment triggersorder.update!if the Order or thePayment is complete. That update needs to operate on the in-memory order
object or things can get out of sync.
It seems like this would be worth getting into Solidus 1.4.
In a Solidus sandbox without this patch:
With this patch:
There is some important history around this particular
inverse_of--see #407 and spree-contrib/spree_gateway#132.
Commit d7b8c73 removed part of the specs around this,
assuming that the
inverse_ofwas automatically added, but it doesn'tactually seem to be (see above). The remaining tests around the issue
still pass.
I think I need to look further into the details of the prior issues to ensure
that we won't bring back bugs with this. Any extra eyes or thoughts are
appreciated. Any ideas on specs to add with this are also welcome.