-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Change order state to merged instead of destroying it when merging orders
#3486
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| class AddMergedToOrderId < ActiveRecord::Migration[5.2] | ||
| def change | ||
| add_column :spree_orders, :merged_to_order_id, :integer, limit: 4 | ||
| add_foreign_key :spree_orders, :spree_orders, column: :merged_to_order_id | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would also consider adding a
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @elia I think that would be redundant. We have 2.6.3 :001 > order2.state_changes
=> [#<Spree::StateChange:0x00007fea97cd4f90
id: 1,
name: "order",
previous_state: "cart",
stateful_id: 2,
user_id: 2,
stateful_type: "Spree::Order",
next_state: "merged",
created_at: Fri, 07 Feb 2020 11:28:08 UTC +00:00,
updated_at: Fri, 07 Feb 2020 11:28:08 UTC +00:00>] |
||
| end | ||
| 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.
Is there a reason these aren't scopes?
Uh oh!
There was an error while loading. Please reload this page.
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.
Only for consistency with the
::cancelledand::not_canceledclass methods defined just above.