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

Fixed redundant condition in the order "returned" state #6685

Closed
wants to merge 2 commits into from

Conversation

ridem
Copy link
Contributor

@ridem ridem commented Aug 21, 2015

In the way the "return" event in handled in Spree, there is a redundant condition that we could remove.

Line 65 in order/checkout.rb, the same condition appears already:

event :return do
  transition to: :returned,
             from: [:complete, :awaiting_return, :canceled],
             if: :all_inventory_units_returned?
end

It feels it's much better to put the eventual logic about the state machine in the order model rather than in the CustomerReturn model.

@TeatroIO
Copy link

I've prepared a stage to preview changes. Open stage or view logs.

@JDutil
Copy link
Member

JDutil commented Aug 21, 2015

This appears to break the build if you could investigate please.

@bbonislawski
Copy link
Contributor

I think that this is outdated already. If you think that it's not outdated, please mention me in comment and I'll reopen it

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.

None yet

4 participants