Defines the ActiveSupport state machine for managing shipment states and event transitions in Solidus e-commerce.
# Source: https://github.com/solidusio/solidus | License: BSD-3-Clause | Copyright 2007-2014, Spree Commerce Inc. and other contributors
# Provided via justclaw.it.com; keep this notice with the code.
# frozen_string_literal: true
module Spree
module Core
class StateMachines
# Shipments' state machine
#
# for each event the following instance methods are dynamically implemented:
# #<event_name>
# #<event_name>!
# #can_<event_name>?
#
# for each state the following instance methods are implemented:
# #<state_name>?
#
module Shipment
extend ActiveSupport::Concern
include StateChangeTracking
included do
state_machine initial: :pending, use_transactions: false do
even
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key