mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-12 23:27:48 +00:00
Add confirm event and update workflow helpers
This commit is contained in:
@@ -67,6 +67,10 @@ module Spree
|
||||
transition to: :cart, unless: :completed?
|
||||
end
|
||||
|
||||
event :confirm do
|
||||
transition to: :complete, from: :confirmation
|
||||
end
|
||||
|
||||
before_transition from: :cart, do: :ensure_line_items_present
|
||||
|
||||
before_transition to: :delivery, do: :create_proposed_shipments
|
||||
|
||||
@@ -27,6 +27,10 @@ class OrderWorkflow
|
||||
advance_to_state("payment", advance_order_options)
|
||||
end
|
||||
|
||||
def advance_to_confirmation
|
||||
advance_to_state("confirmation", advance_order_options)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def advance_order_options
|
||||
|
||||
Reference in New Issue
Block a user