Solidus Shipment State Machine (state_machines/shipment.rb)

solidus · core/app/models/spree/core/state_machines/shipment.rb · ruby · BSD-3-Clause
pos, payments, automation, lang:ruby, tag:solidus

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