Skip to content
Discussion options

You must be logged in to vote

For the record, this is by design, though I can understand the confusion.

completed_at records when the checkout finished; it doesn't say anything about the current state. There are a bunch of states an order can be in post-complete, but we keep the timestamp to make it clear that we are in a post-complete state, basically differentiating an order from a cart.

This came up in #2099 back in 2017, and the resolution (#2131) was to add explicit scopes rather than change complete. So for what you want:

user.orders.complete.not_canceled
# or, strictly the complete state only:
user.orders.by_state("complete")

not_canceled and canceled are both scopes on Spree::Order.

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@jarednorman
Comment options

Comment options

You must be logged in to vote
2 replies
@seandawes
Comment options

@jarednorman
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by jarednorman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants