Any reason that an order canceled still keep the completed_at value?
#4800
|
I'm seeing that after order cancellation, the value |
Replies: 3 comments 3 replies
|
completed_at is not what really defines the order state of complete. order state of complete would. completed_at is used to determine historical sales and other reporting as created_at and completed_at are often times lengthy date diff |
|
Thanks for the replies and the explaining Not sure if the concept of it's considering the |
|
For the record, this is by design, though I can understand the confusion.
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")
|
For the record, this is by design, though I can understand the confusion.
completed_atrecords 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:
not_canceledandcanceledare both scopes on Spree::Order.